summaryrefslogtreecommitdiffstats
path: root/Lib/site.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/site.py')
-rw-r--r--Lib/site.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/Lib/site.py b/Lib/site.py
index daa56e1..4602694 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -312,6 +312,10 @@ def _getuserbase():
# Same to sysconfig.get_path('purelib', os.name+'_user')
def _get_path(userbase):
version = sys.version_info
+ if hasattr(sys, 'abiflags') and 't' in sys.abiflags:
+ abi_thread = 't'
+ else:
+ abi_thread = ''
implementation = _get_implementation()
implementation_lower = implementation.lower()
@@ -322,7 +326,7 @@ def _get_path(userbase):
if sys.platform == 'darwin' and sys._framework:
return f'{userbase}/lib/{implementation_lower}/site-packages'
- return f'{userbase}/lib/python{version[0]}.{version[1]}/site-packages'
+ return f'{userbase}/lib/python{version[0]}.{version[1]}{abi_thread}/site-packages'
def getuserbase():
@@ -390,6 +394,10 @@ def getsitepackages(prefixes=None):
implementation = _get_implementation().lower()
ver = sys.version_info
+ if hasattr(sys, 'abiflags') and 't' in sys.abiflags:
+ abi_thread = 't'
+ else:
+ abi_thread = ''
if os.sep == '/':
libdirs = [sys.platlibdir]
if sys.platlibdir != "lib":
@@ -397,7 +405,7 @@ def getsitepackages(prefixes=None):
for libdir in libdirs:
path = os.path.join(prefix, libdir,
- f"{implementation}{ver[0]}.{ver[1]}",
+ f"{implementation}{ver[0]}.{ver[1]}{abi_thread}",
"site-packages")
sitepackages.append(path)
else: