17
17
from email .generator import BytesGenerator , Generator
18
18
from io import BytesIO
19
19
from shutil import rmtree
20
- from sysconfig import get_config_var
21
20
from zipfile import ZIP_DEFLATED , ZIP_STORED
22
21
23
22
import pkg_resources
@@ -55,7 +54,7 @@ def get_platform(archive_root):
55
54
def get_flag (var , fallback , expected = True , warn = True ):
56
55
"""Use a fallback value for determining SOABI flags if the needed config
57
56
var is unset or unavailable."""
58
- val = get_config_var (var )
57
+ val = sysconfig . get_config_var (var )
59
58
if val is None :
60
59
if warn :
61
60
warnings .warn (
@@ -69,8 +68,8 @@ def get_flag(var, fallback, expected=True, warn=True):
69
68
70
69
71
70
def get_abi_tag ():
72
- """Return the ABI tag based on SOABI (if available) or emulate SOABI (PyPy )."""
73
- soabi = get_config_var ("SOABI" )
71
+ """Return the ABI tag based on SOABI (if available) or emulate SOABI (PyPy2 )."""
72
+ soabi = sysconfig . get_config_var ("SOABI" )
74
73
impl = tags .interpreter_name ()
75
74
if not soabi and impl in ("cp" , "pp" ) and hasattr (sys , "maxunicode" ):
76
75
d = ""
@@ -87,9 +86,9 @@ def get_abi_tag():
87
86
m = "m"
88
87
89
88
abi = f"{ impl } { tags .interpreter_version ()} { d } { m } { u } "
90
- elif soabi and soabi . startswith ( "cpython-" ) :
89
+ elif soabi and impl == "cp" :
91
90
abi = "cp" + soabi .split ("-" )[1 ]
92
- elif soabi and soabi . startswith ( "pypy-" ) :
91
+ elif soabi and impl == "pp" :
93
92
# we want something like pypy36-pp73
94
93
abi = "-" .join (soabi .split ("-" )[:2 ])
95
94
abi = abi .replace ("." , "_" ).replace ("-" , "_" )
0 commit comments