]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Fix ArrayOfEnum's handling of empty arrays.
authorChase <adeodatus@users.noreply.github.com>
Wed, 20 Jan 2016 06:36:15 +0000 (22:36 -0800)
committerChase <adeodatus@users.noreply.github.com>
Wed, 20 Jan 2016 06:36:15 +0000 (22:36 -0800)
Prior to this change a value of `'{}'` would split into the list `['']`.

lib/sqlalchemy/dialects/postgresql/base.py

index 266cfb91266249dbd8550985c6bd8ccad21dd90c..692305319c5154abd76a7436d6a097cedf9a6744 100644 (file)
@@ -579,7 +579,7 @@ use the following workaround type::
 
             def handle_raw_string(value):
                 inner = re.match(r"^{(.*)}$", value).group(1)
-                return inner.split(",")
+                return inner.split(",") if inner else []
 
             def process(value):
                 if value is None: