From: Fred Drake Date: Fri, 11 May 2001 19:52:03 +0000 (+0000) Subject: [].index() raises ValueError if the value is not in the list, so only X-Git-Tag: v2.2a3~1804 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ef4cdad0905c55d921d899cb8b91e58ec6beeb80;p=thirdparty%2FPython%2Fcpython.git [].index() raises ValueError if the value is not in the list, so only catch that instead of using a bare except clause. --- diff --git a/Demo/tix/samples/Control.py b/Demo/tix/samples/Control.py index b8e1156582d3..4b31ced5da86 100755 --- a/Demo/tix/samples/Control.py +++ b/Demo/tix/samples/Control.py @@ -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.