From: Kyle Stark Date: Mon, 13 Jan 2014 16:52:31 +0000 (-0800) Subject: Fix TypeError for class_mapper called w/ iterable X-Git-Tag: rel_0_8_5~51 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=26b899e9ac150f9458924964046356a2b69f1fb5;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git 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 --- diff --git a/lib/sqlalchemy/orm/util.py b/lib/sqlalchemy/orm/util.py index cc2751f2e2..b7abf49315 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