Commit 89051a95 authored by Jérome Perrin's avatar Jérome Perrin

[-1:] also does not fail when string is empty. Thanks Vincent for the tip


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37270 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 765de7f2
......@@ -444,7 +444,7 @@ class DB(TM):
# XXX deal with a typical mistake that the user appends
# an unnecessary and rather harmful semicolon at the end.
# Unfortunately, MySQLdb does not want to be graceful.
if query_string.endswith(';'):
if query_string[-1:] == ';':
query_string = query_string[:-1]
for qs in filter(None, map(strip,split(query_string, '\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