diff options
Diffstat (limited to 'odoo/sql_db.py')
| -rw-r--r-- | odoo/sql_db.py | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/odoo/sql_db.py b/odoo/sql_db.py index f2448259e10..81b717ef026 100644 --- a/odoo/sql_db.py +++ b/odoo/sql_db.py @@ -642,15 +642,9 @@ class Connection(object): # serialized_cursor is deprecated - cursors are serialized by default serialized_cursor = cursor - def __nonzero__(self): - """Check if connection is possible""" - try: - _logger.info("__nonzero__() is deprecated. (It is too expensive to test a connection.)") - cr = self.cursor() - cr.close() - return True - except Exception: - return False + def __bool__(self): + raise NotImplementedError() + __nonzero__ = __bool__ def connection_info_for(db_or_uri): """ parse the given `db_or_uri` and return a 2-tuple (dbname, connection_params) |
