def _inspect_mapped_object(instance):
try:
return instance_state(instance)
- # TODO: whats the py-2/3 syntax to catch two
- # different kinds of exceptions at once ?
- except exc.UnmappedClassError:
- return None
- except exc.NO_STATE:
+ except (exc.UnmappedClassError,) + exc.NO_STATE:
return None
def _default_unmapped(base, cls):
try:
mappers = base.manager_of_class(cls).mappers
- except NO_STATE:
- mappers = {}
- except TypeError:
+ except (TypeError,) + NO_STATE:
mappers = {}
name = _safe_cls_name(cls)