[Python-checkins] r76278 - in python/branches/release26-maint: Lib/test/regrtest.py Misc/NEWS

r.david.murray python-checkins at python.org
Sun Nov 15 01:17:18 CET 2009


Author: r.david.murray
Date: Sun Nov 15 01:17:17 2009
New Revision: 76278

Log:
Merged revisions 76276-76277 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r76276 | r.david.murray | 2009-11-14 19:04:32 -0500 (Sat, 14 Nov 2009) | 3 lines
  
  Issue 7324: add a sanity check to regrtest argument parsing to
  catch the case of an option with no handler.
........
  r76277 | r.david.murray | 2009-11-14 19:07:00 -0500 (Sat, 14 Nov 2009) | 3 lines
  
  Remove 'g' from regrtest getopt argument string, since there's no
  handler for it.
........


Modified:
   python/branches/release26-maint/   (props changed)
   python/branches/release26-maint/Lib/test/regrtest.py
   python/branches/release26-maint/Misc/NEWS

Modified: python/branches/release26-maint/Lib/test/regrtest.py
==============================================================================
--- python/branches/release26-maint/Lib/test/regrtest.py	(original)
+++ python/branches/release26-maint/Lib/test/regrtest.py	Sun Nov 15 01:17:17 2009
@@ -205,7 +205,7 @@
 
     test_support.record_original_stdout(sys.stdout)
     try:
-        opts, args = getopt.getopt(sys.argv[1:], 'hvgqxsSrf:lu:t:TD:NLR:wM:',
+        opts, args = getopt.getopt(sys.argv[1:], 'hvqxsSrf:lu:t:TD:NLR:wM:',
                                    ['help', 'verbose', 'quiet', 'exclude',
                                     'single', 'slow', 'random', 'fromfile',
                                     'findleaks', 'use=', 'threshold=', 'trace',
@@ -285,6 +285,10 @@
                         use_resources.remove(r)
                 elif r not in use_resources:
                     use_resources.append(r)
+        else:
+            print >>sys.stderr, ("No handler for option {0}.  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!")
 

Modified: python/branches/release26-maint/Misc/NEWS
==============================================================================
--- python/branches/release26-maint/Misc/NEWS	(original)
+++ python/branches/release26-maint/Misc/NEWS	Sun Nov 15 01:17:17 2009
@@ -82,6 +82,9 @@
 Tests
 -----
 
+- Issue #7324: add a sanity check to regrtest argument parsing to
+  catch the case of an option with no handler.
+
 - Issue #7295: Do not use a hardcoded file name in test_tarfile.
 
 - Issue #7270: Add some dedicated unit tests for multi-thread synchronization


More information about the Python-checkins mailing list