[Erp5-report] r37270 jerome - /erp5/trunk/products/ZMySQLDA/db.py

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Jul 26 13:49:53 CEST 2010


Author: jerome
Date: Mon Jul 26 13:49:52 2010
New Revision: 37270

URL: http://svn.erp5.org?rev=37270&view=rev
Log:
[-1:] also does not fail when string is empty. Thanks Vincent for the tip

Modified:
    erp5/trunk/products/ZMySQLDA/db.py

Modified: erp5/trunk/products/ZMySQLDA/db.py
URL: http://svn.erp5.org/erp5/trunk/products/ZMySQLDA/db.py?rev=37270&r1=37269&r2=37270&view=diff
==============================================================================
--- erp5/trunk/products/ZMySQLDA/db.py [utf8] (original)
+++ erp5/trunk/products/ZMySQLDA/db.py [utf8] Mon Jul 26 13:49:52 2010
@@ -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])




More information about the Erp5-report mailing list