diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-05-10 18:24:18 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-10 18:24:18 +0000 |
commit | 5abecea34cd98537f006c5e9a197acd1fe9db023 (patch) | |
tree | 98248bc21aa4ad9715205f0a65a654532c6cfcc0 /modules/modelloader.py | |
parent | f5ea1e9d928e0d45b3ebcd8ddd1cacbc6a96e184 (diff) | |
parent | 3ec7b705c78b7aca9569c92a419837352c7a4ec6 (diff) | |
download | stable-diffusion-webui-gfx803-5abecea34cd98537f006c5e9a197acd1fe9db023.tar.gz stable-diffusion-webui-gfx803-5abecea34cd98537f006c5e9a197acd1fe9db023.tar.bz2 stable-diffusion-webui-gfx803-5abecea34cd98537f006c5e9a197acd1fe9db023.zip |
Merge pull request #10259 from AUTOMATIC1111/ruff
Ruff
Diffstat (limited to 'modules/modelloader.py')
-rw-r--r-- | modules/modelloader.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/modules/modelloader.py b/modules/modelloader.py index cb85ac4f..25612bf8 100644 --- a/modules/modelloader.py +++ b/modules/modelloader.py @@ -1,4 +1,3 @@ -import glob import os import shutil import importlib @@ -40,7 +39,7 @@ def load_models(model_path: str, model_url: str = None, command_path: str = None if os.path.islink(full_path) and not os.path.exists(full_path): print(f"Skipping broken symlink: {full_path}") continue - if ext_blacklist is not None and any([full_path.endswith(x) for x in ext_blacklist]): + if ext_blacklist is not None and any(full_path.endswith(x) for x in ext_blacklist): continue if full_path not in output: output.append(full_path) @@ -108,12 +107,12 @@ def move_files(src_path: str, dest_path: str, ext_filter: str = None): print(f"Moving {file} from {src_path} to {dest_path}.") try: shutil.move(fullpath, dest_path) - except: + except Exception: pass if len(os.listdir(src_path)) == 0: print(f"Removing empty folder: {src_path}") shutil.rmtree(src_path, True) - except: + except Exception: pass @@ -141,7 +140,7 @@ def load_upscalers(): full_model = f"modules.{model_name}_model" try: importlib.import_module(full_model) - except: + except Exception: pass datas = [] |