diff options
author | Fedora Python maintainers <python-devel@lists.fedoraproject.org> | 2020-07-15 15:16:05 +0200 |
---|---|---|
committer | Petr Viktorin <pviktori@redhat.com> | 2020-09-29 15:31:18 +0200 |
commit | ed2cf1791b0b0a3b216a16f40457cbb5f07fcfd2 (patch) | |
tree | f1466fc3f7725f1b6b3d76bc33337c9f5b07a252 | |
parent | 3aa4074d50e5e1b0f75165bad71335417442b3a4 (diff) | |
download | cpython-git-ed2cf1791b0b0a3b216a16f40457cbb5f07fcfd2.tar.gz |
00010-2.7.13-binutils-no-dep.patch
FIXME: Lib/ctypes/util.py posix implementation defines a function
_get_soname(f). Upstreams's implementation of this uses objdump to read the
SONAME from a library; we avoid this, apparently to minimize space
requirements on the live CD:
(rhbz:307221)
-rw-r--r-- | Lib/ctypes/util.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py index ab10ec52ee..923d1b7271 100644 --- a/Lib/ctypes/util.py +++ b/Lib/ctypes/util.py @@ -140,11 +140,15 @@ elif os.name == "posix": # assuming GNU binutils / ELF if not f: return None - cmd = 'if ! type objdump >/dev/null 2>&1; then exit; fi;' \ + cmd = 'if ! type objdump >/dev/null 2>&1; then exit 10; fi;' \ 'objdump -p -j .dynamic 2>/dev/null "$1"' proc = subprocess.Popen((cmd, '_get_soname', f), shell=True, stdout=subprocess.PIPE) [dump, _] = proc.communicate() + if proc.returncode == 10: + return os.path.basename(f) # This is good for GLibc, I think, + # and a dep on binutils is big (for + # live CDs). res = re.search(br'\sSONAME\s+([^\s]+)', dump) if not res: return None |