]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue 7324: add a sanity check to regrtest argument parsing to
authorR. David Murray <rdmurray@bitdance.com>
Sun, 15 Nov 2009 00:04:32 +0000 (00:04 +0000)
committerR. David Murray <rdmurray@bitdance.com>
Sun, 15 Nov 2009 00:04:32 +0000 (00:04 +0000)
catch the case of an option with no handler.

Lib/test/regrtest.py
Misc/NEWS

index 7785f37ebcbdbdf359036d97a6556507a47f15d3..2a3f92a30ffd3c3c595d02fd00291133e2956495 100755 (executable)
@@ -344,6 +344,10 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
             print   # Force a newline (just in case)
             print json.dumps(result)
             sys.exit(0)
+        else:
+            print >>sys.stderr, ("No handler for option {}.  Please "
+                "report this as a bug at http://bugs.python.org.").format(o)
+            sys.exit(1)
     if single and fromfile:
         usage(2, "-s and -f don't go together!")
     if use_mp and trace:
index 4e2b131bfdeaa760df29c2ef96c4cd034130cc6f..afa286de6efdc02f6a89fb4e5f4474ff05fe5c4b 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -1567,6 +1567,9 @@ Extension Modules
 Tests
 -----
 
+- Issue #7324: add a sanity check to regrtest argument parsing to
+  catch the case of an option with no handler.
+
 - Issue #7312: Add a -F flag to run the selected tests in a loop until
   a test fails.  Can be combined with -j.