mirror of https://github.com/bmaltais/kohya_ss
fix: replace bare except clauses with except Exception
Bare `except:` catches BaseException including KeyboardInterrupt and SystemExit. Replaced 4 instances with `except Exception:`.pull/3489/head
parent
4161d1d80a
commit
d6a1931369
|
|
@ -1439,7 +1439,7 @@ def validate_toml_file(file_path: str) -> bool:
|
|||
|
||||
try:
|
||||
toml.load(file_path)
|
||||
except:
|
||||
except Exception:
|
||||
log.error(f"{msg} FAILED: is not a valid toml file.")
|
||||
return False
|
||||
log.info(f"{msg} SUCCESS")
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ def setup_logging(clean=False, debug=False):
|
|||
if clean and os.path.isfile("setup.log"):
|
||||
os.remove("setup.log")
|
||||
time.sleep(0.1) # prevent race condition
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ def _get_tag_checkbox_updates(caption, quick_tags, quick_tags_set):
|
|||
def paginate_go(page, max_page):
|
||||
try:
|
||||
page = float(page)
|
||||
except:
|
||||
except Exception:
|
||||
msgbox(f"Invalid page num: {page}")
|
||||
return
|
||||
return paginate(page, max_page, 0)
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class SDModelType:
|
|||
self.model_type = ModelType.SD2
|
||||
elif hasKeyPrefix("model."):
|
||||
self.model_type = ModelType.SD1
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# print(f"Model type: {self.model_type}")
|
||||
|
|
|
|||
Loading…
Reference in New Issue