]> granicus.if.org Git - python/commitdiff
A class used as an exception should inherit from Exception.
authorGuido van Rossum <guido@python.org>
Sat, 7 Apr 2007 03:04:01 +0000 (03:04 +0000)
committerGuido van Rossum <guido@python.org>
Sat, 7 Apr 2007 03:04:01 +0000 (03:04 +0000)
(Should be backported to 2.6, really.)

Lib/pydoc.py

index 9551982315cf8e70963580ba89db5dcba0ba31a7..a74b97b4d099fd5ce3d5549f3f012ecf4dad5416 100755 (executable)
@@ -2187,7 +2187,7 @@ def ispath(x):
 def cli():
     """Command-line interface (looks at sys.argv to decide what to do)."""
     import getopt
-    class BadUsage: pass
+    class BadUsage(Exception): pass
 
     # Scripts don't get the current directory in their path by default.
     scriptdir = os.path.dirname(sys.argv[0])