MCPcopy Index your code
hub / github.com/RustPython/RustPython / invoke_excepthook

Function invoke_excepthook

Lib/threading.py:1324–1354  ·  view source on GitHub ↗
(thread)

Source from the content-addressed store, hash-verified

1322 local_sys = _sys
1323
1324 def invoke_excepthook(thread):
1325 global excepthook
1326 try:
1327 hook = excepthook
1328 if hook is None:
1329 hook = old_excepthook
1330
1331 args = ExceptHookArgs([*sys_exc_info(), thread])
1332
1333 hook(args)
1334 except Exception as exc:
1335 exc.__suppress_context__ = True
1336 del exc
1337
1338 if local_sys is not None and local_sys.stderr is not None:
1339 stderr = local_sys.stderr
1340 else:
1341 stderr = thread._stderr
1342
1343 local_print("Exception in threading.excepthook:",
1344 file=stderr, flush=True)
1345
1346 if local_sys is not None and local_sys.excepthook is not None:
1347 sys_excepthook = local_sys.excepthook
1348 else:
1349 sys_excepthook = old_sys_excepthook
1350
1351 sys_excepthook(*sys_exc_info())
1352 finally:
1353 # Break reference cycle (exception stored in a variable)
1354 args = None
1355
1356 return invoke_excepthook
1357

Callers

nothing calls this directly

Calls 2

ExceptHookArgsClass · 0.90
hookFunction · 0.85

Tested by

no test coverage detected