What is the correct fix?
try:
run()
except:
pass
- Catch the specific exception
- Move
run()out of the try - Replace
passwithreturn - Add an
elseclause after
A bare except swallows everything, including KeyboardInterrupt and real bugs.
Play Problem Solving ▸