summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-02-23 17:58:48 (GMT)
committerGuido van Rossum <guido@python.org>1999-02-23 17:58:48 (GMT)
commit74ee8864093e944ca6f21c69bee5aff02cf58f92 (patch)
tree3c288aa888622c6777d4481b47521812ce58b2c3 /Lib/test
parent264bd59221ab02998c4893f707051818c7b9a927 (diff)
downloadcpython-74ee8864093e944ca6f21c69bee5aff02cf58f92.zip
cpython-74ee8864093e944ca6f21c69bee5aff02cf58f92.tar.gz
cpython-74ee8864093e944ca6f21c69bee5aff02cf58f92.tar.bz2
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.
Diffstat (limited to 'Lib/test')
-rwxr-xr-xLib/test/test_dl.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_dl.py b/Lib/test/test_dl.py
index e7902cc..53c98e6 100755
--- a/Lib/test/test_dl.py
+++ b/Lib/test/test_dl.py
@@ -8,6 +8,7 @@ from test_support import verbose
sharedlibs = [
('/usr/lib/libc.so', 'getpid'),
+ ('/lib/libc.so.6', 'getpid'),
]
for s, func in sharedlibs:
@@ -15,9 +16,9 @@ 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:
@@ -28,4 +29,4 @@ for s, func in sharedlibs:
print 'worked!'
break
else:
- print 'Could not open any shared libraries'
+ raise ImportError, 'Could not open any shared libraries'