Skip to content

Commit

Permalink
fixup setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
arvidn committed Dec 21, 2020
1 parent e866d54 commit 574ac29
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bindings/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def __init__(self, name):


def escape(string):
return string.replace('\\', '\\\\')
return '"' + string.replace('\\', '\\\\') + '"'


def write_b2_python_config(target, config):
Expand All @@ -91,13 +91,13 @@ def write_b2_python_config(target, config):

# Note that on debian, the extension suffix is overwritten, but it's
# necessary everywhere else, or else b2 will just build "libtorrent.so".
# python.jam appends EXT_SUFFIX on its own.
# python.jam appends SHLIB_SUFFIX on its own.
target = target.name.split("libtorrent")[1]
suffix = sysconfig.get_config_var("EXT_SUFFIX")
suffix = sysconfig.get_config_var("SHLIB_SUFFIX")
if suffix != None and target.endswith(suffix):
target = target[:-len(suffix)]

using = f'using python : {sysconfig.get_python_version()} : "{escape(sys.executable)}" : {" ".join(escape(path) for path in includes)} : : <libtorrent-python>on : "{target}" ;\n'
using = f'using python : {sysconfig.get_python_version()} : {escape(sys.executable)} : {" ".join(escape(path) for path in includes)} : : <libtorrent-python>on : "{target}" ;\n'
print(using)
write(using)

Expand Down

0 comments on commit 574ac29

Please sign in to comment.