7575import _sitebuiltins
7676import io
7777import stat
78- import warnings
7978
8079# Prefixes for site-packages; add additional prefixes like /usr/local here
8180PREFIXES = [sys .prefix , sys .exec_prefix ]
@@ -319,15 +318,6 @@ def joinuser(*args):
319318# Same to sysconfig.get_path('purelib', os.name+'_user')
320319def _get_path (userbase ):
321320 version = sys .version_info
322- with warnings .catch_warnings ():
323- # ignore DeprecationWarning on sys.abiflags change on Windows
324- warnings .simplefilter ('ignore' , DeprecationWarning )
325- abiflags = getattr (sys , 'abiflags' , '' )
326- if 't' in abiflags :
327- abi_thread = 't'
328- else :
329- abi_thread = ''
330-
331321 implementation = _get_implementation ()
332322 implementation_lower = implementation .lower ()
333323 if os .name == 'nt' :
@@ -337,6 +327,7 @@ def _get_path(userbase):
337327 if sys .platform == 'darwin' and sys ._framework :
338328 return f'{ userbase } /lib/{ implementation_lower } /site-packages'
339329
330+ abi_thread = 't' if 't' in sys .abiflags else ''
340331 return f'{ userbase } /lib/python{ version [0 ]} .{ version [1 ]} { abi_thread } /site-packages'
341332
342333
@@ -405,15 +396,8 @@ def getsitepackages(prefixes=None):
405396
406397 implementation = _get_implementation ().lower ()
407398 ver = sys .version_info
408- with warnings .catch_warnings ():
409- # ignore DeprecationWarning on sys.abiflags change on Windows
410- warnings .simplefilter ('ignore' , DeprecationWarning )
411- abiflags = getattr (sys , 'abiflags' , '' )
412- if 't' in abiflags :
413- abi_thread = 't'
414- else :
415- abi_thread = ''
416- if os .sep == '/' :
399+ if os .name != 'nt' :
400+ abi_thread = 't' if 't' in sys .abiflags else ''
417401 libdirs = [sys .platlibdir ]
418402 if sys .platlibdir != "lib" :
419403 libdirs .append ("lib" )
0 commit comments