From de9525a73e5166c1d624aba6580ad2316a0e87e0 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 17 Mar 2013 23:29:24 -0700 Subject: [PATCH] no need to use getattr() here --- lib/sqlalchemy/sql/compiler.py | 6 +++--- lib/sqlalchemy/sql/expression.py | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 90e9067277..7660393328 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -787,14 +787,14 @@ class SQLCompiler(engine.Compiled): existing = self.binds[name] if existing is not bindparam: if (existing.unique or bindparam.unique) and \ - not existing.proxy_set.intersection(bindparam.proxy_set): + not existing.proxy_set.intersection( + bindparam.proxy_set): raise exc.CompileError( "Bind parameter '%s' conflicts with " "unique bind parameter of the same name" % bindparam.key ) - elif getattr(existing, '_is_crud', False) or \ - getattr(bindparam, '_is_crud', False): + elif existing._is_crud or bindparam._is_crud: raise exc.CompileError( "bindparam() name '%s' is reserved " "for automatic usage in the VALUES or SET " diff --git a/lib/sqlalchemy/sql/expression.py b/lib/sqlalchemy/sql/expression.py index 7f6867e4a3..5cef778bbb 100644 --- a/lib/sqlalchemy/sql/expression.py +++ b/lib/sqlalchemy/sql/expression.py @@ -2873,6 +2873,8 @@ class BindParameter(ColumnElement): __visit_name__ = 'bindparam' quote = None + _is_crud = False + def __init__(self, key, value, type_=None, unique=False, callable_=None, isoutparam=False, required=False, -- 2.47.3