[].index() raises ValueError if the value is not in the list, so only

catch that instead of using a bare except clause.
This commit is contained in:
Fred Drake 2001-05-11 19:44:55 +00:00
parent a2133339ff
commit 7def256410
1 changed files with 1 additions and 1 deletions

View File

@ -294,7 +294,7 @@ def spin_validate(w):
try:
i = states.index(demo_spintxt.get())
except:
except ValueError:
return states[0]
return states[i]
# why this procedure works as opposed to the previous one beats me.