[Python-checkins] r70249 - python/branches/py3k/Lib/importlib/test/source/util.py

brett.cannon python-checkins at python.org
Mon Mar 9 01:02:02 CET 2009


Author: brett.cannon
Date: Mon Mar  9 01:02:01 2009
New Revision: 70249

Log:
Make importlib.test.source.util.write_bytecode reset sys.dont_write_bytecode.

Modified:
   python/branches/py3k/Lib/importlib/test/source/util.py

Modified: python/branches/py3k/Lib/importlib/test/source/util.py
==============================================================================
--- python/branches/py3k/Lib/importlib/test/source/util.py	(original)
+++ python/branches/py3k/Lib/importlib/test/source/util.py	Mon Mar  9 01:02:01 2009
@@ -14,7 +14,11 @@
     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):


More information about the Python-checkins mailing list