summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/postgresql/base.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-04-26 19:48:43 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2013-04-26 19:48:43 -0400
commit9a1c505d321b09a8cc4b7e16549f2023b60c247e (patch)
tree6d858c4db5b70698450f4f202ab742d5ec2549a1 /lib/sqlalchemy/dialects/postgresql/base.py
parentd3ca368921999f7776958480e12a5d8570b3ca90 (diff)
downloadsqlalchemy-9a1c505d321b09a8cc4b7e16549f2023b60c247e.tar.gz
need to test for (list, tuple) here and not hasattr("__iter__")
since Py3K strings have __iter__
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/base.py')
-rw-r--r--lib/sqlalchemy/dialects/postgresql/base.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py
index 5d9368893..1acdb57b9 100644
--- a/lib/sqlalchemy/dialects/postgresql/base.py
+++ b/lib/sqlalchemy/dialects/postgresql/base.py
@@ -673,7 +673,10 @@ class ARRAY(sqltypes.Concatenable, sqltypes.TypeEngine):
if dim is None:
arr = list(arr)
if dim == 1 or dim is None and (
- not arr or not hasattr(arr[0], '__iter__')):
+ # this has to be (list, tuple), or at least
+ # not hasattr('__iter__'), since Py3K strings
+ # etc. have __iter__
+ not arr or not isinstance(arr[0], (list, tuple))):
if itemproc:
return collection(itemproc(x) for x in arr)
else: