From: Brett Cannon Date: Mon, 9 Mar 2009 00:02:01 +0000 (+0000) Subject: Make importlib.test.source.util.write_bytecode reset sys.dont_write_bytecode. X-Git-Tag: v3.1a2~307 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f2b55fb5ee0374babd770dd5aabad5045a1f78dc;p=python Make importlib.test.source.util.write_bytecode reset sys.dont_write_bytecode. --- diff --git a/Lib/importlib/test/source/util.py b/Lib/importlib/test/source/util.py index 333647d52f..f02d4918ac 100644 --- a/Lib/importlib/test/source/util.py +++ b/Lib/importlib/test/source/util.py @@ -14,7 +14,11 @@ def writes_bytecode(fxn): if sys.dont_write_bytecode: return lambda *args, **kwargs: None else: - return fxn + def wrapper(*args, **kwargs): + to_return = fxn(*args, **kwargs) + sys.dont_write_bytecode = False + return to_return + return wrapper def bytecode_path(source_path):