Kaydet (Commit) 74ee8864 authored tarafından Guido van Rossum's avatar Guido van Rossum

1. Print the error message (carefully) when a dl.open() fails in verbose mode.

2. When no test case worked, raise ImportError instead of failing.
üst 264bd592
...@@ -8,6 +8,7 @@ from test_support import verbose ...@@ -8,6 +8,7 @@ from test_support import verbose
sharedlibs = [ sharedlibs = [
('/usr/lib/libc.so', 'getpid'), ('/usr/lib/libc.so', 'getpid'),
('/lib/libc.so.6', 'getpid'),
] ]
for s, func in sharedlibs: for s, func in sharedlibs:
...@@ -15,9 +16,9 @@ for s, func in sharedlibs: ...@@ -15,9 +16,9 @@ for s, func in sharedlibs:
if verbose: if verbose:
print 'trying to open:', s, print 'trying to open:', s,
l = dl.open(s) l = dl.open(s)
except dl.error: except dl.error, err:
if verbose: if verbose:
print 'failed' print 'failed', repr(str(err))
pass pass
else: else:
if verbose: if verbose:
...@@ -28,4 +29,4 @@ for s, func in sharedlibs: ...@@ -28,4 +29,4 @@ for s, func in sharedlibs:
print 'worked!' print 'worked!'
break break
else: else:
print 'Could not open any shared libraries' raise ImportError, 'Could not open any shared libraries'
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