@@ -72,6 +72,8 @@ def links_against_libpython():
72
72
variables = sysconfig .get_config_vars ()
73
73
variables .update ({'base_prefix' : getattr (sys , 'base_prefix' , sys .prefix )})
74
74
75
+ is_pypy = '__pypy__' in sys .builtin_module_names
76
+
75
77
if sys .version_info < (3 , 0 ):
76
78
suffix = variables .get ('SO' )
77
79
elif sys .version_info < (3 , 8 , 7 ):
@@ -92,7 +94,7 @@ def links_against_libpython():
92
94
# pypy supports modules targetting the limited api but
93
95
# does not use a special suffix to distinguish them:
94
96
# https://doc.pypy.org/en/latest/cpython_differences.html#permitted-abi-tags-in-extensions
95
- if '__pypy__' in sys . builtin_module_names :
97
+ if is_pypy :
96
98
limited_api_suffix = suffix
97
99
98
100
print (json .dumps ({
@@ -102,7 +104,7 @@ def links_against_libpython():
102
104
'install_paths' : install_paths ,
103
105
'version' : sysconfig .get_python_version (),
104
106
'platform' : sysconfig .get_platform (),
105
- 'is_pypy' : '__pypy__' in sys . builtin_module_names ,
107
+ 'is_pypy' : is_pypy ,
106
108
'is_venv' : sys .prefix != variables ['base_prefix' ],
107
109
'link_libpython' : links_against_libpython (),
108
110
'suffix' : suffix ,
0 commit comments