summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/__main__.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/unittest/__main__.py')
-rw-r--r--Lib/unittest/__main__.py9
1 files changed, 8 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