Changed naked except statements to catch only subclasses of Exception #5

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@IanLewis

Naked except statements catch subclasses of BaseException which
can occur anywhere (i.e. KeyboardInterrupt).

Unexpected issues can occur when the exception happens during the
loading of a module. The python interpreter doesn't know about a
module's failed load and does not remove it from sys.modules. This
is particularly a problem on AppEngine where DeadlineExceededErrors
can occur anywhere and modules that catch the error cause python to
think the module is loaded but in fact the module load has failed.

See: http://code.google.com/p/googleappengine/issues/detail?id=1409

If any of the changed imports look like they might be problematic please comment.

@IanLewis IanLewis Changed naked except statements to catch only subclasses of Exception.
Naked except statements catch subclasses of BaseException which
can occur anywhere (i.e. KeyboardInterrupt).

Unexpected issues can occur when the exception happens during the
loading of a module. The python interpreter doesn't know about a
module's failed load and does not remove it from sys.modules. This
is particularly a problem on AppEngine where python will think the
module is loaded but in fact the module load has failed.

See: http://code.google.com/p/googleappengine/issues/detail?id=1409
4809720
@mitsuhiko
The Pallets Projects member

Thanks. Pulled.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment