mirror of
https://github.com/python/cpython.git
synced 2025-07-19 17:25:54 +00:00
bpo-20443: No longer make sys.argv[0] absolute for script (GH-17534)
In Python 3.9.0a1, sys.argv[0] was made an asolute path if a filename was specified on the command line. Revert this change, since most users expect sys.argv to be unmodified.
This commit is contained in:
parent
d219cc4180
commit
a1a99b4bb7
4 changed files with 8 additions and 9 deletions
|
@ -2198,10 +2198,6 @@ config_update_argv(PyConfig *config, Py_ssize_t opt_index)
|
|||
/* Force sys.argv[0] = '-m'*/
|
||||
arg0 = L"-m";
|
||||
}
|
||||
else if (config->run_filename != NULL) {
|
||||
/* run_filename is converted to an absolute path: update argv */
|
||||
arg0 = config->run_filename;
|
||||
}
|
||||
|
||||
if (arg0 != NULL) {
|
||||
arg0 = _PyMem_RawWcsdup(arg0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue