]> granicus.if.org Git - python/commitdiff
Make importlib.test.source.util.write_bytecode reset sys.dont_write_bytecode.
authorBrett Cannon <bcannon@gmail.com>
Mon, 9 Mar 2009 00:02:01 +0000 (00:02 +0000)
committerBrett Cannon <bcannon@gmail.com>
Mon, 9 Mar 2009 00:02:01 +0000 (00:02 +0000)
Lib/importlib/test/source/util.py

index 333647d52f32f3db5f162b89c6b4d16ca5648334..f02d4918aca959a65a205f4388db62a909dc279c 100644 (file)
@@ -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):