[Python-checkins] cpython (merge 3.4 -> 3.5): Merge: #24903: Remove misleading error message to fix regression.

r.david.murray python-checkins at python.org
Fri Dec 4 23:05:45 EST 2015


https://hg.python.org/cpython/rev/c65e135df1dc
changeset:   99440:c65e135df1dc
branch:      3.5
parent:      99437:ae27ad306dbf
parent:      99439:b63fd82a8528
user:        R David Murray <rdmurray at bitdance.com>
date:        Fri Dec 04 23:04:37 2015 -0500
summary:
  Merge: #24903: Remove misleading error message to fix regression.

files:
  Lib/compileall.py           |  3 ---
  Lib/test/test_compileall.py |  8 --------
  Misc/ACKS                   |  1 +
  Misc/NEWS                   |  4 ++++
  4 files changed, 5 insertions(+), 11 deletions(-)


diff --git a/Lib/compileall.py b/Lib/compileall.py
--- a/Lib/compileall.py
+++ b/Lib/compileall.py
@@ -238,9 +238,6 @@
     args = parser.parse_args()
     compile_dests = args.compile_dest
 
-    if (args.ddir and (len(compile_dests) != 1
-            or not os.path.isdir(compile_dests[0]))):
-        parser.exit('-d destdir requires exactly one directory argument')
     if args.rx:
         import re
         args.rx = re.compile(args.rx)
diff --git a/Lib/test/test_compileall.py b/Lib/test/test_compileall.py
--- a/Lib/test/test_compileall.py
+++ b/Lib/test/test_compileall.py
@@ -398,14 +398,6 @@
         self.assertCompiled(init2fn)
         self.assertCompiled(bar2fn)
 
-    def test_d_takes_exactly_one_dir(self):
-        rc, out, err = self.assertRunNotOK('-d', 'foo')
-        self.assertEqual(out, b'')
-        self.assertRegex(err, b'-d')
-        rc, out, err = self.assertRunNotOK('-d', 'foo', 'bar')
-        self.assertEqual(out, b'')
-        self.assertRegex(err, b'-d')
-
     def test_d_compile_error(self):
         script_helper.make_script(self.pkgdir, 'crunchyfrog', 'bad(syntax')
         rc, out, err = self.assertRunNotOK('-q', '-d', 'dinsdale', self.pkgdir)
diff --git a/Misc/ACKS b/Misc/ACKS
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -477,6 +477,7 @@
 Nitin Ganatra
 Fred Gansevles
 Lars Marius Garshol
+Jake Garver
 Dan Gass
 Andrew Gaul
 Matthieu Gautier
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -22,6 +22,10 @@
 Library
 -------
 
+- Issue #24903: Fix regression in number of arguments compileall accepts when
+  '-d' is specified.  The check on the number of arguments has been dropped
+  completely as it never worked correctly anyway.
+
 - Issue #25764: In the subprocess module, preserve any exception caused by
   fork() failure when preexec_fn is used.
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list