summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2017-05-23 23:25:25 (GMT)
committerGitHub <noreply@github.com>2017-05-23 23:25:25 (GMT)
commit9b33bf50dae997b01dfe24878a58100da61b89e1 (patch)
tree53f8a3012f23ba54c53a87a541e27d9901c39ea8 /Python
parent66dc33b6822be93f85d84d24d3f9159ff568fbbb (diff)
downloadcpython-9b33bf50dae997b01dfe24878a58100da61b89e1.zip
cpython-9b33bf50dae997b01dfe24878a58100da61b89e1.tar.gz
cpython-9b33bf50dae997b01dfe24878a58100da61b89e1.tar.bz2
Improves test_underpth_nosite_file to reveal why it fails. (#1763)
* Improves test_underpth_nosite_file to reveal why it fails. * Enable building with Windows 10 SDK. * Fix WinSDK detection * Fix initialization on Windows when a ._pth file exists. * Fix tabs * Adds comment about Py_GetPath call.
Diffstat (limited to 'Python')
-rw-r--r--Python/pylifecycle.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index 03601ea..d2b2777 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -412,10 +412,15 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib)
if (interp->sysdict == NULL)
Py_FatalError("Py_Initialize: can't initialize sys dict");
Py_INCREF(interp->sysdict);
+
+ /* GetPath may initialize state that _PySys_EndInit locks
+ in, and so has to be called first.
+
+ Hopefully one day Eric Snow will fix this. */
+ PySys_SetPath(Py_GetPath());
if (_PySys_EndInit(interp->sysdict) < 0)
Py_FatalError("Py_Initialize: can't initialize sys");
_PyImport_FixupBuiltin(sysmod, "sys");
- PySys_SetPath(Py_GetPath());
PyDict_SetItemString(interp->sysdict, "modules",
interp->modules);