Skip to content
Myr

addressed a few review concerns

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Phil Schaf · committed by Phil Schaf · parent 8c054f0 · Browse files · 1 file+6 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−6 removed

  • other:+6 added−6 removed

1 file+6 added−6 removed

modified:flask/app.py+6 added-6 removed
1078 unmodified lines
1079 return decorator10801081 @staticmethod1082 def _get_exc_class_and_code(exc_class_or_code):1083 """ensure that we register only exceptions as handler keys"""1083 """Ensure that we register only exceptions as handler keys"""1084 if isinstance(exc_class_or_code, integer_types):1085 exc_class = default_exceptions[exc_class_or_code]1086 else:1087 exc_class = exc_class_or_code
323 unmodified lines
1411 If neither blueprint nor App has a suitable handler registered, returns None1412 """1413 exc_class, code = self._get_exc_class_and_code(type(e))1414 1415 def find_superclass(d):1416 if not d:1415 def find_superclass(handler_map):1416 if not handler_map:1417 return None1418 for superclass in exc_class.mro():1418 for superclass in exc_class.__mro__:1419 if superclass is BaseException:1420 return None1421 handler = d.get(superclass)1421 handler = handler_map.get(superclass)1422 if handler is not None:1423 d[exc_class] = handler # cache for next time exc_class is raised1423 handler_map[exc_class] = handler # cache for next time exc_class is raised1424 return handler1425 return None1426 1427 # try blueprint handlers
538 unmodified lines