summaryrefslogtreecommitdiffstats
path: root/Lib/importlib
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2009-03-09 00:02:01 (GMT)
committerBrett Cannon <bcannon@gmail.com>2009-03-09 00:02:01 (GMT)
commitf2b55fb5ee0374babd770dd5aabad5045a1f78dc (patch)
tree00253bb29a16dc763e44544578f4e7053effee56 /Lib/importlib
parente8662063028a77ae89fc73c0d7721f9818a3d004 (diff)
downloadcpython-f2b55fb5ee0374babd770dd5aabad5045a1f78dc.zip
cpython-f2b55fb5ee0374babd770dd5aabad5045a1f78dc.tar.gz
cpython-f2b55fb5ee0374babd770dd5aabad5045a1f78dc.tar.bz2
Make importlib.test.source.util.write_bytecode reset sys.dont_write_bytecode.
Diffstat (limited to 'Lib/importlib')
-rw-r--r--Lib/importlib/test/source/util.py6
1 files changed, 5 insertions, 1 deletions
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):