mirror of
https://github.com/python/cpython.git
synced 2026-04-25 21:30:45 +00:00
bpo-36236: Handle removed cwd at Python init (GH-12450)
At Python initialization, the current directory is no longer prepended to sys.path if it has been removed.
This commit is contained in:
parent
935250d6f3
commit
f7959a9fe7
5 changed files with 36 additions and 36 deletions
|
|
@ -2615,7 +2615,10 @@ PySys_SetArgvEx(int argc, wchar_t **argv, int updatepath)
|
|||
if (updatepath) {
|
||||
/* If argv[0] is not '-c' nor '-m', prepend argv[0] to sys.path.
|
||||
If argv[0] is a symlink, use the real path. */
|
||||
PyObject *argv0 = _PyPathConfig_ComputeArgv0(argc, argv);
|
||||
PyObject *argv0 = NULL;
|
||||
if (!_PyPathConfig_ComputeArgv0(argc, argv, &argv0)) {
|
||||
return;
|
||||
}
|
||||
if (argv0 == NULL) {
|
||||
Py_FatalError("can't compute path0 from argv");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue