Commit 94f47be5 authored by Antoine Pitrou's avatar Antoine Pitrou

Revert r88639 (the optimization changes behaviour and breaks buildbots)

parent 1ab5b679
...@@ -102,12 +102,5 @@ class LoaderTest(unittest.TestCase): ...@@ -102,12 +102,5 @@ class LoaderTest(unittest.TestCase):
# This is the real test: call the function via 'call_function' # This is the real test: call the function via 'call_function'
self.assertEqual(0, call_function(proc, (None,))) self.assertEqual(0, call_function(proc, (None,)))
if os.name != "nt":
def test_libc_exists(self):
# A basic test that the libc is found by find_library()
# XXX Can this fail on some non-Windows systems?
self.assertTrue(libc_name)
self.assertTrue(os.path.exists(libc_name))
if __name__ == "__main__": if __name__ == "__main__":
unittest.main() unittest.main()
...@@ -203,18 +203,14 @@ elif os.name == "posix": ...@@ -203,18 +203,14 @@ elif os.name == "posix":
abi_type = mach_map.get(machine, 'libc6') abi_type = mach_map.get(machine, 'libc6')
# XXX assuming GLIBC's ldconfig (with option -p) # XXX assuming GLIBC's ldconfig (with option -p)
name = 'lib%s' % name expr = r'(\S+)\s+\((%s(?:, OS ABI:[^\)]*)?)\)[^/]*(/[^\(\)\s]*lib%s\.[^\(\)\s]*)' \
pat = re.compile('\s*(/[^\(\)\s]*%s\.[^\(\)\s]*)' % re.escape(name)) % (abi_type, re.escape(name))
with contextlib.closing(os.popen('LC_ALL=C LANG=C /sbin/ldconfig -p 2>/dev/null')) as f: with contextlib.closing(os.popen('LC_ALL=C LANG=C /sbin/ldconfig -p 2>/dev/null')) as f:
for line in f: data = f.read()
if not '=>' in line: res = re.search(expr, data)
continue if not res:
path = line.rsplit('=>', 1)[1] return None
if not name+'.' in path: return res.group(1)
continue
res = pat.search(path)
if res:
return res.group(1)
def find_library(name): def find_library(name):
return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name)) return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name))
......
...@@ -329,7 +329,6 @@ Dag Gruneau ...@@ -329,7 +329,6 @@ Dag Gruneau
Michael Guravage Michael Guravage
Lars Gustäbel Lars Gustäbel
Thomas Güttler Thomas Güttler
Jonas H.
Barry Haddow Barry Haddow
Paul ten Hagen Paul ten Hagen
Rasmus Hahn Rasmus Hahn
......
...@@ -35,9 +35,6 @@ Core and Builtins ...@@ -35,9 +35,6 @@ Core and Builtins
Library Library
------- -------
- Issue #11258: Speed up ctypes.util.find_library() under Linux a lot. Patch
by Jonas H.
- Issue #11297: Add collections.ChainMap(). - Issue #11297: Add collections.ChainMap().
- Issue #10755: Add the posix.fdlistdir() function. Patch by Ross Lagerwall. - Issue #10755: Add the posix.fdlistdir() function. Patch by Ross Lagerwall.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment