From ba5f4f568bc702df61e6faac0c316cf06b5bfc64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com> Date: Tue, 20 Apr 2010 16:20:09 +0000 Subject: [PATCH] use constants for MySQLdb rather than 1064 git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34689 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ZMySQLDA/db.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/product/ZMySQLDA/db.py b/product/ZMySQLDA/db.py index fadb5cc109..80858aaf55 100644 --- a/product/ZMySQLDA/db.py +++ b/product/ZMySQLDA/db.py @@ -406,8 +406,8 @@ class DB(TM): self.db.query(query) except ProgrammingError, exception: LOG('ZMySQLDA', ERROR, 'query failed: %s' % (query,)) - if exception[0] == 1064: - # 1064 = You have an error in your SQL syntax + if exception[0] == ER.PARSE_ERROR: + # You have an error in your SQL syntax # Replace MySQL brain dead error message with a more meaningful # one. (MySQL only reports the SQL query *from* the error place, # which strips important contextual information). -- 2.30.9