From b889ee999a9d4375d5e1e043bd3fda5e390d549c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 10 Jun 2008 17:03:56 +0200 Subject: [PATCH] Fix prevent call close on cursor if cursor == None --- trytond/web_service/db.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/trytond/web_service/db.py b/trytond/web_service/db.py index 915489860e..c29c5106fe 100644 --- a/trytond/web_service/db.py +++ b/trytond/web_service/db.py @@ -72,7 +72,8 @@ class DB(Service): logger.notify_channel("web-service", LOG_INFO, 'CREATE DB: %s' % (db_name,)) finally: - cursor.close() + if cursor: + cursor.close() return res def drop(self, password, db_name):