From: Marko Kreen Date: Fri, 29 Mar 2013 11:33:41 +0000 (+0200) Subject: parse_pgarray: allow None X-Git-Tag: skytools_3_1_5~5 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=d33f3ae9e971fc1957ec6280d16708280f55d498;p=skytools.git parse_pgarray: allow None --- diff --git a/python/skytools/parsing.py b/python/skytools/parsing.py index 318b1bf9..3d16a3a1 100644 --- a/python/skytools/parsing.py +++ b/python/skytools/parsing.py @@ -25,6 +25,8 @@ def parse_pgarray(array): >>> parse_pgarray("[0,3]={1,2,3}") ['1', '2', '3'] """ + if array is None: + return None if not array or array[0] not in ("{", "[") or array[-1] != '}': raise Exception("bad array format: must be surrounded with {}") res = []