From e813db1ea2ad0ba648f13ecd319ceab04133e242 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 20 Sep 2013 00:33:51 +0200 Subject: [PATCH] Use Transaction to set correct Flavor review1076002 --- proteus/config.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/proteus/config.py b/proteus/config.py index c87dbc1f8f..a71e9b719f 100644 --- a/proteus/config.py +++ b/proteus/config.py @@ -197,12 +197,9 @@ class TrytondConfig(Config): Pool.start() - database = backend.get('Database')().connect() - cursor = database.cursor() - try: - databases = database.list(cursor) - finally: - cursor.close() + with Transaction().start(None, 0) as transaction: + cursor = transaction.cursor + databases = backend.get('Database').list(cursor) if database_name not in databases: create(database_name, CONFIG['admin_passwd'], language, password)