diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-07-31 22:01:53 +0300 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2023-08-23 15:40:31 +0300 |
commit | 12171ca9612cb36024b7f524c08750fdc57b3a96 (patch) | |
tree | 32bef0474afededafbe0ca7a89ec96ccf0d17138 /modules/sysinfo.py | |
parent | 56236dfd3fde4476217d92cc6767fa3a88c829e4 (diff) |
fix memory leak when generation fails
Diffstat (limited to 'modules/sysinfo.py')
-rw-r--r-- | modules/sysinfo.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/sysinfo.py b/modules/sysinfo.py index 5f15ac4f..cf24c6dd 100644 --- a/modules/sysinfo.py +++ b/modules/sysinfo.py @@ -109,11 +109,15 @@ def format_traceback(tb): return [[f"{x.filename}, line {x.lineno}, {x.name}", x.line] for x in traceback.extract_tb(tb)]
+def format_exception(e, tb):
+ return {"exception": str(e), "traceback": format_traceback(tb)}
+
+
def get_exceptions():
try:
from modules import errors
- return [{"exception": str(e), "traceback": format_traceback(tb)} for e, tb in reversed(errors.exception_records)]
+ return list(reversed(errors.exception_records))
except Exception as e:
return str(e)
|