[FIX] osv: Remove lookup for backward compatibility with psycopg2 < 2.0.14
authorCecile Tonglet <cto@openerp.com>
Wed, 13 Feb 2013 17:11:23 +0000 (18:11 +0100)
committerCecile Tonglet <cto@openerp.com>
Wed, 13 Feb 2013 17:11:23 +0000 (18:11 +0100)
bzr revid: cto@openerp.com-20130213171123-lak7oy9lm73zbwiq

bin/osv/osv.py

index 938ec30..3f8d679 100644 (file)
@@ -132,11 +132,11 @@ class object_proxy(netsvc.Service):
                     if e.pgcode not in PG_CONCURRENCY_ERRORS_TO_RETRY:
                         raise
                     if tries >= MAX_TRIES_ON_CONCURRENCY_FAILURE:
-                        self.logger.warning("%s, maximum number of tries reached" % errorcodes.lookup(e.pgcode))
+                        self.logger.warning("%s, maximum number of tries reached" % e.pgcode)
                         raise
                     wait_time = random.uniform(0.0, 2 ** tries)
                     tries += 1
-                    self.logger.info("%s, retrying %d/%d in %.04f sec..." % (errorcodes.lookup(e.pgcode), tries, MAX_TRIES_ON_CONCURRENCY_FAILURE, wait_time))
+                    self.logger.info("%s, retrying %d/%d in %.04f sec..." % (e.pgcode, tries, MAX_TRIES_ON_CONCURRENCY_FAILURE, wait_time))
                     time.sleep(wait_time)
                 except orm.except_orm, inst:
                     if inst.name == 'AccessError':