bpo-32030: Add Python/pathconfig.c (#4668)

* Factorize code from PC/getpathp.c and Modules/getpath.c to remove
  duplicated code
* rename pathconfig_clear() to _PyPathConfig_Clear()
* Inline _PyPathConfig_Fini() in pymain_impl() and then remove it,
  since it's a oneliner
This commit is contained in:
Victor Stinner 2017-12-01 20:50:58 +01:00 committed by GitHub
parent ebac19dad6
commit 0ea395ae96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 204 additions and 291 deletions

View file

@ -1665,12 +1665,12 @@ pymain_impl(_PyMain *pymain)
pymain->status = 120;
}
/* _PyPathConfig_Fini() cannot be called in Py_FinalizeEx().
/* _PyPathConfig_Clear() cannot be called in Py_FinalizeEx().
Py_Initialize() and Py_Finalize() can be called multiple times, but it
must not "forget" parameters set by Py_SetProgramName(), Py_SetPath() or
Py_SetPythonHome(), whereas _PyPathConfig_Fini() clear all these
Py_SetPythonHome(), whereas _PyPathConfig_Clear() clear all these
parameters. */
_PyPathConfig_Fini();
_PyPathConfig_Clear(&_Py_path_config);
return 0;
}