From 63c211f42730011760aa8e3f88b2171b23bc0a60 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 22 Apr 2013 17:24:31 -0400 Subject: tweak this some more to handle the array being empty again --- lib/sqlalchemy/dialects/postgresql/base.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lib/sqlalchemy/dialects/postgresql/base.py') diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index 82660d96c..5d9368893 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -671,11 +671,9 @@ class ARRAY(sqltypes.Concatenable, sqltypes.TypeEngine): def _proc_array(self, arr, itemproc, dim, collection): if dim is None: - if arr is None: - arr = [] - else: - arr = list(arr) - if dim == 1 or dim is None and not hasattr(arr[0], '__iter__'): + arr = list(arr) + if dim == 1 or dim is None and ( + not arr or not hasattr(arr[0], '__iter__')): if itemproc: return collection(itemproc(x) for x in arr) else: -- cgit v1.2.1