Catch Python 2.7 deprecation warning

This commit is contained in:
Valentin Niess
2020-04-04 00:48:39 +02:00
parent 999fcf8083
commit 8c5bdaf5b7
5 changed files with 36 additions and 19 deletions

View File

@@ -44,12 +44,12 @@ def patch_binary(path, libdir, recursive=True):
excluded = _excluded_libs
ensure_patchelf()
rpath = '\'' + system(PATCHELF, '--print-rpath', path) + '\''
rpath = '\'' + system((PATCHELF, '--print-rpath', path)) + '\''
relpath = os.path.relpath(libdir, os.path.dirname(path))
relpath = '' if relpath == '.' else '/' + relpath
expected = '\'$ORIGIN' + relpath + '\''
if rpath != expected:
system(PATCHELF, '--set-rpath', expected, path)
system((PATCHELF, '--set-rpath', expected, path))
deps = ldd(path)
for dep in deps:
@@ -78,8 +78,8 @@ def relocate_python(python=None, appdir=None):
# Set some key variables & paths
if python:
FULLVERSION = system(python, '-c',
'"import sys; print(\'{:}.{:}.{:}\'.format(*sys.version_info[:3]))"')
FULLVERSION = system((python, '-c',
'"import sys; print(\'{:}.{:}.{:}\'.format(*sys.version_info[:3]))"'))
FULLVERSION = FULLVERSION.strip()
else:
FULLVERSION = '{:}.{:}.{:}'.format(*sys.version_info[:3])
@@ -92,8 +92,8 @@ def relocate_python(python=None, appdir=None):
APPDIR_SHARE = APPDIR + '/usr/share'
if python:
HOST_PREFIX = system(
python, '-c', '"import sys; print(sys.prefix)"').strip()
HOST_PREFIX = system((
python, '-c', '"import sys; print(sys.prefix)"')).strip()
else:
HOST_PREFIX = sys.prefix
HOST_BIN = HOST_PREFIX + '/bin'