summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Stark <kyle@goodrx.com>2014-01-13 08:52:31 -0800
committerKyle Stark <kyle@goodrx.com>2014-01-13 08:52:31 -0800
commit58d3a4147361315fec2979e7bf933f4bd30ae46b (patch)
treeca934274c63d3a4f1c80233fb7e4b656573e3619
parent5d973d52aa7d1e5b715ffb99800642cc2af4d972 (diff)
downloadsqlalchemy-pr/58.tar.gz
Fix TypeError for class_mapper called w/ iterablepr/58
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).
-rw-r--r--lib/sqlalchemy/orm/base.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/base.py b/lib/sqlalchemy/orm/base.py
index e3b75eda0..577f9ff76 100644
--- a/lib/sqlalchemy/orm/base.py
+++ b/lib/sqlalchemy/orm/base.py
@@ -375,7 +375,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