mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-121103: Put free-threaded libraries in lib/python3.14t
(#121293)
On POSIX systems, excluding macOS framework installs, the lib directory for the free-threaded build now includes a "t" suffix to avoid conflicts with a co-located default build installation.
This commit is contained in:
parent
5250a03133
commit
e8c91d90ba
13 changed files with 77 additions and 40 deletions
12
Lib/site.py
12
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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue