Resolves new warning

This commit is contained in:
Trenton H 2024-05-03 13:30:01 -07:00
parent ee45b29e66
commit c53a4796fe

View File

@ -37,11 +37,11 @@ def worker_int(worker):
id2name = {th.ident: th.name for th in threading.enumerate()}
code = []
for threadId, stack in sys._current_frames().items():
code.append("\n# Thread: %s(%d)" % (id2name.get(threadId, ""), threadId))
code.append(f"\n# Thread: {id2name.get(threadId, '')}({threadId})")
for filename, lineno, name, line in traceback.extract_stack(stack):
code.append('File: "%s", line %d, in %s' % (filename, lineno, name))
code.append(f'File: "{filename}", line {lineno}, in {name}')
if line:
code.append(" %s" % (line.strip()))
code.append(f" {line.strip()}")
worker.log.debug("\n".join(code))