aboutsummaryrefslogtreecommitdiffstats
path: root/modules/safe.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2023-05-31 16:56:37 +0000
committerAUTOMATIC <16777216c@gmail.com>2023-05-31 16:56:37 +0000
commit05933840f0676dd1a90a7e2ad3f2a0672624b2cd (patch)
tree593940d16fdc678c275b2b2f21ac6df7c6aad959 /modules/safe.py
parentd67ef01f629d2034fb847dae6aa0143c87161b8f (diff)
downloadstable-diffusion-webui-gfx803-05933840f0676dd1a90a7e2ad3f2a0672624b2cd.tar.gz
stable-diffusion-webui-gfx803-05933840f0676dd1a90a7e2ad3f2a0672624b2cd.tar.bz2
stable-diffusion-webui-gfx803-05933840f0676dd1a90a7e2ad3f2a0672624b2cd.zip
rename print_error to report, use it with together with package name
Diffstat (limited to 'modules/safe.py')
-rw-r--r--modules/safe.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/safe.py b/modules/safe.py
index b596f565..b1d08a79 100644
--- a/modules/safe.py
+++ b/modules/safe.py
@@ -9,9 +9,10 @@ import _codecs
import zipfile
import re
-from modules.errors import print_error
# PyTorch 1.13 and later have _TypedStorage renamed to TypedStorage
+from modules import errors
+
TypedStorage = torch.storage.TypedStorage if hasattr(torch.storage, 'TypedStorage') else torch.storage._TypedStorage
def encode(*args):
@@ -136,7 +137,7 @@ def load_with_extra(filename, extra_handler=None, *args, **kwargs):
check_pt(filename, extra_handler)
except pickle.UnpicklingError:
- print_error(
+ errors.report(
f"Error verifying pickled file from {filename}\n"
"-----> !!!! The file is most likely corrupted !!!! <-----\n"
"You can skip this check with --disable-safe-unpickle commandline argument, but that is not going to help you.\n\n",
@@ -144,7 +145,7 @@ def load_with_extra(filename, extra_handler=None, *args, **kwargs):
)
return None
except Exception:
- print_error(
+ errors.report(
f"Error verifying pickled file from {filename}\n"
f"The file may be malicious, so the program is not going to read it.\n"
f"You can skip this check with --disable-safe-unpickle commandline argument.\n\n",