]> granicus.if.org Git - python/commitdiff
1. Print the error message (carefully) when a dl.open() fails in verbose mode.
authorGuido van Rossum <guido@python.org>
Tue, 23 Feb 1999 17:58:48 +0000 (17:58 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 23 Feb 1999 17:58:48 +0000 (17:58 +0000)
2. When no test case worked, raise ImportError instead of failing.

Lib/test/test_dl.py

index e7902cc5e06533b8bbd6bd9def645c9f99e1f805..53c98e68fe5bee955a13afd40297416bbb1e6e39 100755 (executable)
@@ -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'