summaryrefslogtreecommitdiffstats
path: root/Lib/importlib
diff options
context:
space:
mode:
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):