File tree Expand file tree Collapse file tree 3 files changed +31
-7
lines changed Expand file tree Collapse file tree 3 files changed +31
-7
lines changed Original file line number Diff line number Diff line change @@ -547,12 +547,16 @@ def test_underpth_nosite_file(self):
547
547
env = os .environ .copy ()
548
548
env ['PYTHONPATH' ] = 'from-env'
549
549
env ['PATH' ] = '{};{}' .format (exe_prefix , os .getenv ('PATH' ))
550
- rc = subprocess .call ([exe_file , '-c' ,
551
- 'import sys; sys.exit(sys.flags.no_site and '
552
- 'len(sys.path) > 200 and '
553
- 'sys.path == %r)' % sys_path ,
554
- ], env = env )
555
- self .assertTrue (rc , "sys.path is incorrect" )
550
+ output = subprocess .check_output ([exe_file , '-c' ,
551
+ 'import sys; print("\\ n".join(sys.path) if sys.flags.no_site else "")'
552
+ ], env = env , encoding = 'ansi' )
553
+ actual_sys_path = output .rstrip ().split ('\n ' )
554
+ self .assert_ (actual_sys_path , "sys.flags.no_site was False" )
555
+ self .assertEqual (
556
+ actual_sys_path ,
557
+ sys_path ,
558
+ "sys.path is incorrect"
559
+ )
556
560
557
561
def test_underpth_file (self ):
558
562
libpath = os .path .dirname (os .path .dirname (encodings .__file__ ))
Original file line number Diff line number Diff line change 63
63
<PythonExe Condition =" '$(PythonExe)' == ''" >$(BuildPath)python$(PyDebugExt).exe</PythonExe >
64
64
</PropertyGroup >
65
65
66
+ <PropertyGroup Condition =" $(DefaultWindowsSDKVersion) == ''" >
67
+ <!--
68
+ Attempt to select the latest installed WinSDK. If we don't find any, then we will
69
+ let the MSBuild targets determine which one it wants to use (typically the earliest
70
+ possible version). Since we limit WINVER to Windows 7 anyway, it doesn't really
71
+ matter which WinSDK version we use.
72
+ -->
73
+ <DefaultWindowsSDKVersion Condition =" $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0@ProductVersion) == '10.0.15063'" >10.0.15063.0</DefaultWindowsSDKVersion >
74
+ <DefaultWindowsSDKVersion Condition =" $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v10.0@ProductVersion) == '10.0.15063'" >10.0.15063.0</DefaultWindowsSDKVersion >
75
+ <DefaultWindowsSDKVersion Condition =" $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0@ProductVersion) == '10.0.10586'" >10.0.10586.0</DefaultWindowsSDKVersion >
76
+ <DefaultWindowsSDKVersion Condition =" $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v10.0@ProductVersion) == '10.0.10586'" >10.0.10586.0</DefaultWindowsSDKVersion >
77
+ <DefaultWindowsSDKVersion Condition =" $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0@ProductVersion) == '10.0.10240'" >10.0.10240.0</DefaultWindowsSDKVersion >
78
+ <DefaultWindowsSDKVersion Condition =" $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v10.0@ProductVersion) == '10.0.10240'" >10.0.10240.0</DefaultWindowsSDKVersion >
79
+ </PropertyGroup >
80
+
66
81
<PropertyGroup Condition =" '$(OverrideVersion)' == ''" >
67
82
<!--
68
83
Read version information from Include\patchlevel.h. The following properties are set:
Original file line number Diff line number Diff line change @@ -412,10 +412,15 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib)
412
412
if (interp -> sysdict == NULL )
413
413
Py_FatalError ("Py_Initialize: can't initialize sys dict" );
414
414
Py_INCREF (interp -> sysdict );
415
+
416
+ /* GetPath may initialize state that _PySys_EndInit locks
417
+ in, and so has to be called first.
418
+
419
+ Hopefully one day Eric Snow will fix this. */
420
+ PySys_SetPath (Py_GetPath ());
415
421
if (_PySys_EndInit (interp -> sysdict ) < 0 )
416
422
Py_FatalError ("Py_Initialize: can't initialize sys" );
417
423
_PyImport_FixupBuiltin (sysmod , "sys" );
418
- PySys_SetPath (Py_GetPath ());
419
424
PyDict_SetItemString (interp -> sysdict , "modules" ,
420
425
interp -> modules );
421
426
You can’t perform that action at this time.
0 commit comments