summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Stark <kyle@goodrx.com>2014-01-13 08:52:31 -0800
committerMike Bayer <mike_mp@zzzcomputing.com>2014-01-14 20:24:04 -0500
commit26b899e9ac150f9458924964046356a2b69f1fb5 (patch)
tree74bd49dc9249a9a840cf0cd3acd48d3575e9e541
parenta78110a21ccb0606cfc02de05e0a93e9875c384b (diff)
downloadsqlalchemy-26b899e9ac150f9458924964046356a2b69f1fb5.tar.gz
Fix TypeError for class_mapper called w/ iterable
When the class_ passed is not a mapped class but is actually an iterable, the string formatting operation fails with a TypeError, and the expected ArgumentError is not raised. Calling code which is using reflection and expects this error will fail (e.g. the sadisplay module). Conflicts: lib/sqlalchemy/orm/base.py
-rw-r--r--lib/sqlalchemy/orm/util.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/util.py b/lib/sqlalchemy/orm/util.py
index cc2751f2e..b7abf4931 100644
--- a/lib/sqlalchemy/orm/util.py
+++ b/lib/sqlalchemy/orm/util.py
@@ -1147,7 +1147,7 @@ def class_mapper(class_, configure=True):
if mapper is None:
if not isinstance(class_, type):
raise sa_exc.ArgumentError(
- "Class object expected, got '%r'." % class_)
+ "Class object expected, got '%r'." % (class_, ))
raise exc.UnmappedClassError(class_)
else:
return mapper