churchyard / rpms / python2

Forked from rpms/python2 3 years ago
Clone
202761
diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py
202761
index ab10ec5..923d1b7 100644
202761
--- a/Lib/ctypes/util.py
202761
+++ b/Lib/ctypes/util.py
202761
@@ -140,11 +140,15 @@ elif os.name == "posix":
202761
             # assuming GNU binutils / ELF
202761
             if not f:
202761
                 return None
202761
-            cmd = 'if ! type objdump >/dev/null 2>&1; then exit; fi;' \
202761
+            cmd = 'if ! type objdump >/dev/null 2>&1; then exit 10; fi;' \
202761
                   'objdump -p -j .dynamic 2>/dev/null "$1"'
202761
             proc = subprocess.Popen((cmd, '_get_soname', f), shell=True,
202761
                                     stdout=subprocess.PIPE)
202761
             [dump, _] = proc.communicate()
202761
+            if proc.returncode == 10:
202761
+                return os.path.basename(f) #  This is good for GLibc, I think,
202761
+                                           # and a dep on binutils is big (for
202761
+                                           # live CDs).
202761
             res = re.search(br'\sSONAME\s+([^\s]+)', dump)
202761
             if not res:
202761
                 return None