diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-04-22 17:24:31 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-04-22 17:24:31 -0400 |
commit | 63c211f42730011760aa8e3f88b2171b23bc0a60 (patch) | |
tree | 60c5cf727f4c9ec1d26822bf8ae5185d71b25979 /lib/sqlalchemy/dialects/postgresql/base.py | |
parent | d2f8c83e25ea7abb49315c30518f6415b497f1a7 (diff) | |
download | sqlalchemy-63c211f42730011760aa8e3f88b2171b23bc0a60.tar.gz |
tweak this some more to handle the array being empty again
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/base.py')
-rw-r--r-- | lib/sqlalchemy/dialects/postgresql/base.py | 8 |
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: |