]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[].index() raises ValueError if the value is not in the list, so only
authorFred Drake <fdrake@acm.org>
Fri, 11 May 2001 19:52:03 +0000 (19:52 +0000)
committerFred Drake <fdrake@acm.org>
Fri, 11 May 2001 19:52:03 +0000 (19:52 +0000)
catch that instead of using a bare except clause.

Demo/tix/samples/Control.py

index b8e1156582d362c3055f051dd86f16048c180802..4b31ced5da86bbdbb41fd221250c33c739848c7e 100755 (executable)
@@ -86,7 +86,7 @@ def adjust_maker(w, inc):
 def validate_maker(w):
     try:
        i = maker_list.index(demo_maker.get())
-    except:
+    except ValueError:
        # Works here though. Why ? Beats me.
        return maker_list[0]
     # Works here though. Why ? Beats me.