2. When no test case worked, raise ImportError instead of failing.
sharedlibs = [
('/usr/lib/libc.so', 'getpid'),
+ ('/lib/libc.so.6', 'getpid'),
]
for s, func in sharedlibs:
if verbose:
print 'trying to open:', s,
l = dl.open(s)
- except dl.error:
+ except dl.error, err:
if verbose:
- print 'failed'
+ print 'failed', repr(str(err))
pass
else:
if verbose:
print 'worked!'
break
else:
- print 'Could not open any shared libraries'
+ raise ImportError, 'Could not open any shared libraries'