diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sqlalchemy/orm/base.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/sqlalchemy/orm/base.py b/lib/sqlalchemy/orm/base.py index e973de897..e81375787 100644 --- a/lib/sqlalchemy/orm/base.py +++ b/lib/sqlalchemy/orm/base.py @@ -351,12 +351,13 @@ def _inspect_mapped_class(class_, configure=False): if not class_manager.is_mapped: return None mapper = class_manager.mapper + except exc.NO_STATE: + return None + else: if configure and mapper._new_mappers: mapper._configure_all() return mapper - except exc.NO_STATE: - return None def class_mapper(class_, configure=True): """Given a class, return the primary :class:`.Mapper` associated |