Fix logger when self.cursor.query is None

This commit is contained in:
Cédric Krier committed 2009-03-11 01:05:02 +01:00
1 parent 1f9ee4ec7b
commit e3bd17d9bb
1 file changed
+1 -1
+1 -1
View File
@@ -282,7 +282,7 @@ class Cursor(CursorInterface):
res = self.cursor.execute(sql)
except:
logger = logging.getLogger('sql')
logger.error('Wrong SQL: ' + self.cursor.query)
logger.error('Wrong SQL: ' + (self.cursor.query or ''))
raise
if self.sql_log:
res_from = RE_FROM.match(sql.lower())