summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-05-10 23:26:09 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2014-05-10 23:26:09 -0400
commit230c0d5a19978872fae4e1261736a9e300ae9bf1 (patch)
tree40fae1f4feb8ddb43713c802b132d6377dc9cbd8 /lib
parent168ca1d37d0d6ddc3ef6dc993fa561c4f46d0f52 (diff)
downloadsqlalchemy-230c0d5a19978872fae4e1261736a9e300ae9bf1.tar.gz
- Fixed ORM bug where the :func:`.class_mapper` function would mask
AttributeErrors or KeyErrors that should raise during mapper configuration due to user errors. The catch for attribute/keyerror has been made more specific to not include the configuration step. fixes #3047
Diffstat (limited to 'lib')
-rw-r--r--lib/sqlalchemy/orm/base.py5
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