From 5249f293fdb038ebead034e28886e7cd5b5f0408 Mon Sep 17 00:00:00 2001 From: Lorenzo Battistini Date: Thu, 6 Dec 2012 15:46:53 +0100 Subject: [PATCH] [FIX] We better have to use the "with" syntax --- base_report_to_printer/printing.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/base_report_to_printer/printing.py b/base_report_to_printer/printing.py index 1e59684..9207a49 100755 --- a/base_report_to_printer/printing.py +++ b/base_report_to_printer/printing.py @@ -118,10 +118,9 @@ class printing_printer(osv.osv): raise finally: cr.close() - self.lock.acquire() - self.updating = False - self.last_update = time.time() - self.lock.release() + with self.lock: + self.updating = False + self.last_update = time.time() def start_printer_update(self, cr, uid, context):