From 5cc0bb04749922aa13864e495b70b79e8f3fdaf9 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 11 Jun 2012 20:11:05 -0400 Subject: - [bug] Fixed bug affecting Py3K whereby string positional parameters passed to engine/connection execute() would fail to be interpreted correctly, due to __iter__ being present on Py3K string. [ticket:2503]. Also in 0.7.8. --- lib/sqlalchemy/engine/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/sqlalchemy/engine/base.py') diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index f68c31b97..2e05f532c 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -1476,7 +1476,7 @@ class Connection(Connectable): elif len(multiparams) == 1: zero = multiparams[0] if isinstance(zero, (list, tuple)): - if not zero or hasattr(zero[0], '__iter__'): + if not zero or isinstance(zero[0], (list, tuple, dict)): return zero else: return [zero] @@ -1485,7 +1485,7 @@ class Connection(Connectable): else: return [[zero]] else: - if hasattr(multiparams[0], '__iter__'): + if isinstance(multiparams[0], (list, tuple, dict)): return multiparams else: return [multiparams] -- cgit v1.2.1