diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index a3239650555..df8a7b0b411 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -370,6 +370,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(("No handler for option {}. Please report this as a bug " + "at http://bugs.python.org.").format(o), file=sys.stderr) + sys.exit(1) if single and fromfile: usage("-s and -f don't go together!") if use_mp and trace: diff --git a/Misc/NEWS b/Misc/NEWS index bb1799a56a1..7f59447d986 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -378,6 +378,9 @@ Documentation 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.