File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 88
88
USER_BASE = None
89
89
90
90
91
+ # Same as defined in Lib/sysconfig.py
92
+ # redeclared since sysconfig is large for site.
93
+ # GCC[mingw*] use posix build system
94
+ _POSIX_BUILD = os .name == 'posix' or \
95
+ (os .name == "nt" and 'GCC' in sys .version )
96
+
91
97
def _trace (message ):
92
98
if sys .flags .verbose :
93
99
print (message , file = sys .stderr )
@@ -273,7 +279,7 @@ def _getuserbase():
273
279
def joinuser (* args ):
274
280
return os .path .expanduser (os .path .join (* args ))
275
281
276
- if os .name == "nt" :
282
+ if os .name == "nt" and not _POSIX_BUILD :
277
283
base = os .environ .get ("APPDATA" ) or "~"
278
284
return joinuser (base , "Python" )
279
285
@@ -288,7 +294,7 @@ def joinuser(*args):
288
294
def _get_path (userbase ):
289
295
version = sys .version_info
290
296
291
- if os .name == 'nt' :
297
+ if os .name == 'nt' and not _POSIX_BUILD :
292
298
ver_nodot = sys .winver .replace ('.' , '' )
293
299
return f'{ userbase } \\ Python{ ver_nodot } \\ site-packages'
294
300
@@ -361,7 +367,7 @@ def getsitepackages(prefixes=None):
361
367
continue
362
368
seen .add (prefix )
363
369
364
- if os . sep == '/' :
370
+ if _POSIX_BUILD :
365
371
libdirs = [sys .platlibdir ]
366
372
if sys .platlibdir != "lib" :
367
373
libdirs .append ("lib" )
You can’t perform that action at this time.
0 commit comments