]> granicus.if.org Git - python/commitdiff
Catch nis.error and raise TestFailed instead. This catches the
authorBarry Warsaw <barry@python.org>
Thu, 15 May 1997 18:27:49 +0000 (18:27 +0000)
committerBarry Warsaw <barry@python.org>
Thu, 15 May 1997 18:27:49 +0000 (18:27 +0000)
problem where Python is configured with the nismodule but NIS isn't
installed, or the map names don't correspond to those hardcoded in
nismodule.c (which is bogus in and of itself).

Lib/test/test_nis.py

index 9b3910d614f52520491c2f54f528e4a2ebacdb0a..0d345fe5c2ca974c03a266bcf6377201a4ce0f92 100644 (file)
@@ -1,8 +1,13 @@
-from test_support import verbose
+from test_support import verbose, TestFailed
 import nis
 
 print 'nis.maps()'
-maps = nis.maps()
+try:
+    # the following could fail if NIS isn't active
+    maps = nis.maps()
+except nis.error, msg:
+    raise TestFailed, msg 
+
 done = 0
 for nismap in maps:
     if verbose: