summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2011-02-07 12:36:54 (GMT)
committerGeorg Brandl <georg@python.org>2011-02-07 12:36:54 (GMT)
commit4543846517cbb5defb00f1bae82edd30e1280d9e (patch)
tree0dc95793008454a07c4f80034fb03db70d8f3396
parentca583b66c8debea9b083470f9fc3b8ab0589082b (diff)
downloadcpython-4543846517cbb5defb00f1bae82edd30e1280d9e.zip
cpython-4543846517cbb5defb00f1bae82edd30e1280d9e.tar.gz
cpython-4543846517cbb5defb00f1bae82edd30e1280d9e.tar.bz2
#11132: pass optimize parameter to recursive call in compileall.compile_dir(). Reviewed by Eric A.
-rw-r--r--Lib/compileall.py2
-rw-r--r--Lib/test/test_compileall.py10
-rw-r--r--Misc/ACKS1
-rw-r--r--Misc/NEWS3
4 files changed, 15 insertions, 1 deletions
diff --git a/Lib/compileall.py b/Lib/compileall.py
index 1030d8c..d79a1bb 100644
--- a/Lib/compileall.py
+++ b/Lib/compileall.py
@@ -58,7 +58,7 @@ def compile_dir(dir, maxlevels=10, ddir=None, force=False, rx=None,
elif (maxlevels > 0 and name != os.curdir and name != os.pardir and
os.path.isdir(fullname) and not os.path.islink(fullname)):
if not compile_dir(fullname, maxlevels - 1, dfile, force, rx,
- quiet, legacy):
+ quiet, legacy, optimize):
success = 0
return success
diff --git a/Lib/test/test_compileall.py b/Lib/test/test_compileall.py
index 295dc40..250d31b 100644
--- a/Lib/test/test_compileall.py
+++ b/Lib/test/test_compileall.py
@@ -24,6 +24,10 @@ class CompileallTests(unittest.TestCase):
self.source_path2 = os.path.join(self.directory, '_test2.py')
self.bc_path2 = imp.cache_from_source(self.source_path2)
shutil.copyfile(self.source_path, self.source_path2)
+ self.subdirectory = os.path.join(self.directory, '_subdir')
+ os.mkdir(self.subdirectory)
+ self.source_path3 = os.path.join(self.subdirectory, '_test3.py')
+ shutil.copyfile(self.source_path, self.source_path3)
def tearDown(self):
shutil.rmtree(self.directory)
@@ -96,6 +100,12 @@ class CompileallTests(unittest.TestCase):
cached = imp.cache_from_source(self.source_path,
debug_override=not optimize)
self.assertTrue(os.path.isfile(cached))
+ cached2 = imp.cache_from_source(self.source_path2,
+ debug_override=not optimize)
+ self.assertTrue(os.path.isfile(cached2))
+ cached3 = imp.cache_from_source(self.source_path3,
+ debug_override=not optimize)
+ self.assertTrue(os.path.isfile(cached3))
class EncodingTest(unittest.TestCase):
diff --git a/Misc/ACKS b/Misc/ACKS
index 8e12007..c22e360 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -843,6 +843,7 @@ James Thomas
Robin Thomas
Jeremy Thurgood
Eric Tiedemann
+July Tikhonov
Tracy Tims
Oren Tirosh
Jason Tishler
diff --git a/Misc/NEWS b/Misc/NEWS
index 7dbbcbb..80c08c2 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -18,6 +18,9 @@ Core and Builtins
Library
-------
+- Issue #11132: Fix passing of "optimize" parameter when recursing
+ in compileall.compile_dir().
+
- Issue #11110: Fix a potential decref of a NULL in sqlite3.
- Issue #8275: Fix passing of callback arguments with ctypes under Win64.