mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
Closes issue 16064. No longer hard code executable name in unittest help output.
This commit is contained in:
parent
0e1af282b8
commit
d38e6e516d
2 changed files with 10 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue