File tree 1 file changed +9
-5
lines changed 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 13
13
del sys .path [0 ]
14
14
15
15
import json , os , sysconfig
16
- import distutils .command .install
17
16
18
17
def get_distutils_paths (scheme = None , prefix = None ):
19
18
import distutils .dist
@@ -63,10 +62,15 @@ def get_install_paths():
63
62
return paths , install_paths
64
63
65
64
def 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' , [])))
70
74
71
75
def main ():
72
76
variables = sysconfig .get_config_vars ()
You can’t perform that action at this time.
0 commit comments