Commit add35591 authored by Jérome Perrin's avatar Jérome Perrin

don't fail if query_string is empty


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37268 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 87009af8
...@@ -444,7 +444,7 @@ class DB(TM): ...@@ -444,7 +444,7 @@ class DB(TM):
# XXX deal with a typical mistake that the user appends # XXX deal with a typical mistake that the user appends
# an unnecessary and rather harmful semicolon at the end. # an unnecessary and rather harmful semicolon at the end.
# Unfortunately, MySQLdb does not want to be graceful. # Unfortunately, MySQLdb does not want to be graceful.
if query_string[-1] == ';': if query_string.endswith(';'):
query_string = query_string[:-1] query_string = query_string[:-1]
for qs in filter(None, map(strip,split(query_string, '\0'))): for qs in filter(None, map(strip,split(query_string, '\0'))):
qtype = upper(split(qs, None, 1)[0]) qtype = upper(split(qs, None, 1)[0])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment