summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/postgresql/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/base.py')
-rw-r--r--lib/sqlalchemy/dialects/postgresql/base.py8
1 files changed, 3 insertions, 5 deletions
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: