Remove unused code

The exception is never raised because the dict lookup uses
default values, thus it is not used at all.