MCPcopy Index your code
hub / github.com/python/cpython / capture_warnings

Function capture_warnings

Lib/idlelib/run.py:80–91  ·  view source on GitHub ↗

Replace warning.showwarning with idle_showwarning_subproc, or reverse.

(capture)

Source from the content-addressed store, hash-verified

78_warnings_showwarning = None
79
80def capture_warnings(capture):
81 "Replace warning.showwarning with idle_showwarning_subproc, or reverse."
82
83 global _warnings_showwarning
84 if capture:
85 if _warnings_showwarning is None:
86 _warnings_showwarning = warnings.showwarning
87 warnings.showwarning = idle_showwarning_subproc
88 else:
89 if _warnings_showwarning is not None:
90 warnings.showwarning = _warnings_showwarning
91 _warnings_showwarning = None
92
93capture_warnings(True)
94

Callers 3

run.pyFile · 0.70
mainFunction · 0.70
exitFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…