diff options
author | Marko Kreen | 2013-03-29 11:33:41 +0000 |
---|---|---|
committer | Marko Kreen | 2013-04-17 15:35:08 +0000 |
commit | d33f3ae9e971fc1957ec6280d16708280f55d498 (patch) | |
tree | 3e64e2734609c12bc8636ce47adc0936aa9b19d7 | |
parent | a49b2b8c83fd947d796b2093fa745f2733f681f6 (diff) |
parse_pgarray: allow None
-rw-r--r-- | python/skytools/parsing.py | 2 |
1 files changed, 2 insertions, 0 deletions
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 = [] |