File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 1313 del sys .path [0 ]
1414
1515import json , os , sysconfig
16- import distutils .command .install
1716
1817def get_distutils_paths (scheme = None , prefix = None ):
1918 import distutils .dist
@@ -63,10 +62,15 @@ def get_install_paths():
6362 return paths , install_paths
6463
6564def links_against_libpython ():
66- from distutils .core import Distribution , Extension
67- cmd = Distribution ().get_command_obj ('build_ext' )
68- cmd .ensure_finalized ()
69- return bool (cmd .get_libraries (Extension ('dummy' , [])))
65+ # on versions supporting python-embed.pc, this is the non-embed lib
66+ if sys .version_info >= (3 , 12 ):
67+ variables = sysconfig .get_config_vars ()
68+ return bool (variables .get ('LIBPYTHON' , True ))
69+ else :
70+ from distutils .core import Distribution , Extension
71+ cmd = Distribution ().get_command_obj ('build_ext' )
72+ cmd .ensure_finalized ()
73+ return bool (cmd .get_libraries (Extension ('dummy' , [])))
7074
7175def main ():
7276 variables = sysconfig .get_config_vars ()
You can’t perform that action at this time.
0 commit comments