summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Foord <michael@voidspace.org.uk>2012-09-28 14:14:37 (GMT)
committerMichael Foord <michael@voidspace.org.uk>2012-09-28 14:14:37 (GMT)
commitd38e6e516de30158e4bb4e32961c3889f2f69339 (patch)
tree0a412f1afaec213ef02af29d534547b42eb26854
parent0e1af282b8e747c8dc032ea0dbda53f3f4ef17d4 (diff)
downloadcpython-d38e6e516de30158e4bb4e32961c3889f2f69339.zip
cpython-d38e6e516de30158e4bb4e32961c3889f2f69339.tar.gz
cpython-d38e6e516de30158e4bb4e32961c3889f2f69339.tar.bz2
Closes issue 16064. No longer hard code executable name in unittest help output.
-rw-r--r--Lib/unittest/__main__.py9
-rw-r--r--Misc/NEWS2
2 files changed, 10 insertions, 1 deletions
diff --git a/Lib/unittest/__main__.py b/Lib/unittest/__main__.py
index 7320050..798ebc0 100644
--- a/Lib/unittest/__main__.py
+++ b/Lib/unittest/__main__.py
@@ -2,7 +2,14 @@
import sys
if sys.argv[0].endswith("__main__.py"):
- sys.argv[0] = "python -m unittest"
+ import os.path
+ # We change sys.argv[0] to make help message more useful
+ # use executable without path, unquoted
+ # (it's just a hint anyway)
+ # (if you have spaces in your executable you get what you deserve!)
+ executable = os.path.basename(sys.executable)
+ sys.argv[0] = executable + " -m unittest"
+ del os
__unittest = True
diff --git a/Misc/NEWS b/Misc/NEWS
index 33ea266..fe0be74 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -36,6 +36,8 @@ Core and Builtins
Library
-------
+- Issue #16064: unittest -m claims executable is "python", not "python3"
+
- Issue #15222: Insert blank line after each message in mbox mailboxes
- Issue #16013: Fix CSV Reader parsing issue with ending quote characters.