summaryrefslogtreecommitdiff
path: root/openerp/sql_db.py
diff options
context:
space:
mode:
authorAntony Lesuisse <al@openerp.com>2014-03-17 13:43:43 +0100
committerAntony Lesuisse <al@openerp.com>2014-03-17 13:43:43 +0100
commit09deba48268bed7a77050d9b1d9776b485cb44e2 (patch)
tree8b02b1c431fc91f5a5639264143dbd7d425a26b9 /openerp/sql_db.py
parentd3c7750b96253e952f199abdbbb5eede67d3c873 (diff)
[FIX] tests dont generate traceback on aborted test requests
bzr revid: al@openerp.com-20140317124343-kgesa5c215z19vpn
Diffstat (limited to 'openerp/sql_db.py')
-rw-r--r--openerp/sql_db.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/openerp/sql_db.py b/openerp/sql_db.py
index 694ae02b3d9..59841656d8c 100644
--- a/openerp/sql_db.py
+++ b/openerp/sql_db.py
@@ -148,7 +148,7 @@ class Cursor(object):
def check(f):
@wraps(f)
def wrapper(self, *args, **kwargs):
- if self.__closed:
+ if self._closed:
msg = 'Unable to use a closed cursor.'
if self.__closer:
msg += ' It was closed at %s, line %s' % self.__closer
@@ -165,7 +165,7 @@ class Cursor(object):
self.sql_log = _logger.isEnabledFor(logging.DEBUG)
self.sql_log_count = 0
- self.__closed = True # avoid the call of close() (by __del__) if an exception
+ self._closed = True # avoid the call of close() (by __del__) if an exception
# is raised by any of the following initialisations
self._pool = pool
self.dbname = dbname
@@ -180,7 +180,7 @@ class Cursor(object):
self.__caller = frame_codeinfo(currentframe(),2)
else:
self.__caller = False
- self.__closed = False # real initialisation value
+ self._closed = False # real initialisation value
self.autocommit(False)
self.__closer = False
@@ -189,7 +189,7 @@ class Cursor(object):
self.cache = {}
def __del__(self):
- if not self.__closed and not self._cnx.closed:
+ if not self._closed and not self._cnx.closed:
# Oops. 'self' has not been closed explicitly.
# The cursor will be deleted by the garbage collector,
# but the database connection is not put back into the connection
@@ -302,7 +302,7 @@ class Cursor(object):
# collected as fast as they should). The problem is probably due in
# part because browse records keep a reference to the cursor.
del self._obj
- self.__closed = True
+ self._closed = True
# Clean the underlying connection.
self._cnx.rollback()