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

Function silent

Lib/test/test_profile.py:159–165  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

157
158@contextmanager
159def silent():
160 stdout = sys.stdout
161 try:
162 sys.stdout = StringIO()
163 yield
164 finally:
165 sys.stdout = stdout
166
167
168def main():

Callers 2

test_runMethod · 0.85
test_runctxMethod · 0.85

Calls 1

StringIOClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…