summaryrefslogtreecommitdiff
path: root/bin/sql_db.py
diff options
context:
space:
mode:
authorStephane Wirtel <stephane@openerp.com>2010-09-06 16:06:45 +0200
committerStephane Wirtel <stephane@openerp.com>2010-09-06 16:06:45 +0200
commit6b2e5f98962958b8480f629d0b336a3d88bf0066 (patch)
tree7bb51d17269a82d706581df4414b1b2bcb63d7c3 /bin/sql_db.py
parent56d507a7e16007e0a5c6eed1b5a1a98317d3c031 (diff)
[FIX] Use the currentThread function instead of current_thread
bzr revid: stephane@openerp.com-20100906140645-zxt6los8sl54qzj0
Diffstat (limited to 'bin/sql_db.py')
-rw-r--r--bin/sql_db.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/sql_db.py b/bin/sql_db.py
index 438d513b0e4..193a709dd8d 100644
--- a/bin/sql_db.py
+++ b/bin/sql_db.py
@@ -21,7 +21,7 @@
__all__ = ['db_connect', 'close_db']
-from threading import current_thread
+from threading import currentThread
import logging
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT, ISOLATION_LEVEL_READ_COMMITTED, ISOLATION_LEVEL_SERIALIZABLE
from psycopg2.psycopg1 import cursor as psycopg1cursor
@@ -365,13 +365,13 @@ def dsn_are_equals(first, second):
_Pool = ConnectionPool(int(tools.config['db_maxconn']))
def db_connect(db_name):
- current_thread().dbname = db_name
+ currentThread().dbname = db_name
return Connection(_Pool, db_name)
def close_db(db_name):
_Pool.close_all(dsn(db_name))
tools.cache.clean_caches_for_db(db_name)
- ct = current_thread()
+ ct = currentThread()
if hasattr(ct, 'dbname'):
delattr(ct, 'dbname')