From f2b55fb5ee0374babd770dd5aabad5045a1f78dc Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Mon, 9 Mar 2009 00:02:01 +0000 Subject: Make importlib.test.source.util.write_bytecode reset sys.dont_write_bytecode. --- Lib/importlib/test/source/util.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Lib/importlib/test/source/util.py b/Lib/importlib/test/source/util.py index 333647d..f02d491 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): -- cgit v0.12