mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
[].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:
parent
a2133339ff
commit
7def256410
1 changed files with 1 additions and 1 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue