mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
Issue #8202: Set sys.argv[0] to -m rather than -c while searching for the module to execute. Also updates all the cmd_line_script tests to validate the setting of sys.path[0] and the current working directory
This commit is contained in:
parent
46e6380563
commit
d26c18adcc
8 changed files with 130 additions and 53 deletions
|
|
@ -95,8 +95,9 @@ source.
|
|||
file is not available.
|
||||
|
||||
If this option is given, the first element of :data:`sys.argv` will be the
|
||||
full path to the module file. As with the :option:`-c` option, the current
|
||||
directory will be added to the start of :data:`sys.path`.
|
||||
full path to the module file (while the module file is being located, the
|
||||
first element will be set to ``"-m"``). As with the :option:`-c` option,
|
||||
the current directory will be added to the start of :data:`sys.path`.
|
||||
|
||||
Many standard library modules contain code that is invoked on their execution
|
||||
as a script. An example is the :mod:`timeit` module::
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue