Kaydet (Commit) 31f4beb1 authored tarafından Benjamin Peterson's avatar Benjamin Peterson

add a contextmanager to disable the gc

üst c9174945
......@@ -1005,6 +1005,16 @@ def gc_collect():
gc.collect()
gc.collect()
@contextlib.contextmanager
def disable_gc():
have_gc = gc.isenabled()
gc.disable()
try:
yield
finally:
if have_gc:
gc.enable()
def python_is_optimized():
"""Find if Python was built with optimizations."""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment