Kaydet (Commit) 67091776 authored tarafından Collin Winter's avatar Collin Winter

Fix python-config to use the new sysconfig module; silences deprecation warnings.

üst 603b7535
#!@EXENAME@
import sys
import os
import getopt
from distutils import sysconfig
import os
import sys
import sysconfig
valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags',
'ldflags', 'help']
......@@ -31,14 +31,14 @@ if '--help' in opt_flags:
for opt in opt_flags:
if opt == '--prefix':
print(sysconfig.PREFIX)
print(sysconfig.get_config_var('prefix'))
elif opt == '--exec-prefix':
print(sysconfig.EXEC_PREFIX)
print(sysconfig.get_config_var('exec_prefix'))
elif opt in ('--includes', '--cflags'):
flags = ['-I' + sysconfig.get_python_inc(),
'-I' + sysconfig.get_python_inc(plat_specific=True)]
flags = ['-I' + sysconfig.get_path('include'),
'-I' + sysconfig.get_path('platinclude')]
if opt == '--cflags':
flags.extend(getvar('CFLAGS').split())
print(' '.join(flags))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment