Opened 6 years ago

Closed 5 years ago

#3194 closed defect (fixed)

remove bare excepts

Reported by: Greg Couch Owned by: Greg Couch
Priority: major Milestone: 1.0
Component: Infrastructure Version:
Keywords: Cc: chimera-programmers
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

All bare excepts, "except:" should be removed from ChimeraX. Instead, they should be "except Exception:" or "except BaseException:" depending on intent. BaseException catches KeyboardInterrupt and SystemExit in addition to other exceptions, just like a bare except, so another option would be to have explicit except causes for those specific exceptions.

Change History (2)

in reply to:  1 ; comment:1 by goddard@…, 6 years ago

I think ctrl-C from the shell should give a traceback as it does now and not cause ChimeraX to exit.  The user is likely typing ctrl-C because the GUI is hung (e.g. reading a large file).  With the current behavior (no exit) they don't lose their work, and if they want can then exit once the ctrl-C stops the long computation.

I agree that the bare "except:" clauses should be fixed.

comment:2 by Greg Couch, 5 years ago

Resolution: fixed
Status: assignedclosed

All of the bare excepts have been replace with "except Exception".

Note: See TracTickets for help on using tickets.