projects
/
skytools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a49b2b8
)
parse_pgarray: allow None
author
Marko Kreen
<markokr@gmail.com>
Fri, 29 Mar 2013 11:33:41 +0000
(13:33 +0200)
committer
Marko Kreen
<markokr@gmail.com>
Wed, 17 Apr 2013 15:35:08 +0000
(18:35 +0300)
python/skytools/parsing.py
patch
|
blob
|
blame
|
history
diff --git
a/python/skytools/parsing.py
b/python/skytools/parsing.py
index 318b1bf93b8b40ecc8e22adc63d0c5e24b6d1d13..3d16a3a13ebd0e4fa96228d6a4ddbf10068f6fcc 100644
(file)
--- 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 = []