From 893d950cfa534e9ce7cd2ab7b50084696dc4905e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B5=D0=BC=D1=91=D0=BD=20=D0=9C=D0=B0=D1=80=D1=8C?= =?UTF-8?q?=D1=8F=D1=81=D0=B8=D0=BD?= Date: Sun, 24 Jul 2016 01:04:35 +0400 Subject: Fix ArgumentError access in Session._add_bind There is no ArgumentError in sqlalchemy.orm.exc, but there is one in sqlalchemy.exc . How to reproduce this issue (for example): session = Session(binds={None: None}) --- lib/sqlalchemy/orm/session.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/sqlalchemy/orm/session.py') diff --git a/lib/sqlalchemy/orm/session.py b/lib/sqlalchemy/orm/session.py index a7440bf40..400d4740f 100644 --- a/lib/sqlalchemy/orm/session.py +++ b/lib/sqlalchemy/orm/session.py @@ -1122,7 +1122,7 @@ class Session(_SessionClassMethods): insp = inspect(key) except sa_exc.NoInspectionAvailable: if not isinstance(key, type): - raise exc.ArgumentError( + raise as_exc.ArgumentError( "Not acceptable bind target: %s" % key) else: @@ -1135,7 +1135,7 @@ class Session(_SessionClassMethods): for selectable in insp._all_tables: self.__binds[selectable] = bind else: - raise exc.ArgumentError( + raise sa_exc.ArgumentError( "Not acceptable bind target: %s" % key) -- cgit v1.2.1