Skip to content

Commit

Permalink
support relocated python installs, closes swift-lang#127
Browse files Browse the repository at this point in the history
  • Loading branch information
bd4 committed Oct 23, 2018
1 parent 311ec36 commit 193a2d2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions turbine/code/scripts/python-config.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ def get_lib_name():

def get_config_value(name):
if name == 'include-dir':
value = sysconfig.get_config_var('INCLUDEPY')
value = sysconfig.get_paths()['include']
elif name == 'include-flags':
value = '-I' + sysconfig.get_config_var('INCLUDEPY')
value = '-I' + sysconfig.get_paths()['include']
elif name == 'lib-dir':
value = sysconfig.get_config_var('LIBDIR')
value = os.path.join(sysconfig.get_config_var('base'), 'lib')

This comment has been minimized.

Copy link
@bd4

bd4 Oct 23, 2018

Author Owner

This makes me a little nervous - it works in the cases I've tested, but seems like it might be fragile. Only certain sysconfig variables see the change after a python distribution is relocated, so there aren't very many other options. There is unfortunately no value in get_paths that gives the path to the libpython.

elif name == 'lib-name':
value = get_lib_name()
elif name == 'lib-flags':
Expand Down

0 comments on commit 193a2d2

Please sign in to comment.