Revert r88639 (the optimization changes behaviour and breaks buildbots)
This commit is contained in:
parent
ffa1a77c67
commit
09c530dfc8
|
@ -102,12 +102,5 @@ class LoaderTest(unittest.TestCase):
|
|||
# This is the real test: call the function via 'call_function'
|
||||
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__":
|
||||
unittest.main()
|
||||
|
|
|
@ -203,17 +203,13 @@ elif os.name == "posix":
|
|||
abi_type = mach_map.get(machine, 'libc6')
|
||||
|
||||
# XXX assuming GLIBC's ldconfig (with option -p)
|
||||
name = 'lib%s' % name
|
||||
pat = re.compile('\s*(/[^\(\)\s]*%s\.[^\(\)\s]*)' % re.escape(name))
|
||||
expr = r'(\S+)\s+\((%s(?:, OS ABI:[^\)]*)?)\)[^/]*(/[^\(\)\s]*lib%s\.[^\(\)\s]*)' \
|
||||
% (abi_type, re.escape(name))
|
||||
with contextlib.closing(os.popen('LC_ALL=C LANG=C /sbin/ldconfig -p 2>/dev/null')) as f:
|
||||
for line in f:
|
||||
if not '=>' in line:
|
||||
continue
|
||||
path = line.rsplit('=>', 1)[1]
|
||||
if not name+'.' in path:
|
||||
continue
|
||||
res = pat.search(path)
|
||||
if res:
|
||||
data = f.read()
|
||||
res = re.search(expr, data)
|
||||
if not res:
|
||||
return None
|
||||
return res.group(1)
|
||||
|
||||
def find_library(name):
|
||||
|
|
|
@ -329,7 +329,6 @@ Dag Gruneau
|
|||
Michael Guravage
|
||||
Lars Gustäbel
|
||||
Thomas Güttler
|
||||
Jonas H.
|
||||
Barry Haddow
|
||||
Paul ten Hagen
|
||||
Rasmus Hahn
|
||||
|
|
Loading…
Reference in New Issue