Browse Source

Fix additional depreications

pull/27/head
Sandy Carter 11 years ago
parent
commit
82aa4f5763
  1. 6
      base_external_dbsource/base_external_dbsource.py
  2. 2
      cron_run_manually/model/ir_cron.py
  3. 2
      server_environment/serv_config.py
  4. 2
      server_environment/system_info.py

6
base_external_dbsource/base_external_dbsource.py

@ -35,14 +35,14 @@ try:
import pymssql
CONNECTORS.append(('mssql', 'Microsoft SQL Server'))
assert pymssql
except ImportError, AssertionError:
except (ImportError, AssertionError):
_logger.info('MS SQL Server not available. Please install "pymssql"\
python package.')
try:
import MySQLdb
CONNECTORS.append(('mysql', 'MySQL'))
assert MySQLdb
except ImportError, AssertionError:
except (ImportError, AssertionError):
_logger.info('MySQL not available. Please install "mysqldb"\
python package.')
except:
@ -159,7 +159,7 @@ Sample connection strings:
conn = False
try:
conn = self.conn_open(cr, uid, obj.id)
except Exception, e:
except Exception as e:
raise orm.except_orm(_("Connection test failed!"),
_("Here is what we got instead:\n %s")
% tools.ustr(e))

2
cron_run_manually/model/ir_cron.py

@ -70,7 +70,7 @@ class irCron(orm.Model):
args = safe_eval('tuple(%s)' % (job['args'] or ''))
method(cr, job['user_id'], *args)
except psycopg2.OperationalError, e:
except psycopg2.OperationalError as e:
# User friendly error if the lock could not be claimed
if e.pgcode == '55P03':
raise orm.except_orm(

2
server_environment/serv_config.py

@ -93,7 +93,7 @@ def _load_config():
config_p.optionxform = str
try:
config_p.read(conf_files)
except Exception, e:
except Exception as e:
raise Exception('Cannot read config files "%s": %s' % (conf_files, e))
return config_p

2
server_environment/system_info.py

@ -38,7 +38,7 @@ def get_server_environment():
# inspired by server/bin/service/web_services.py
try:
rev_id = _get_output('bzr revision-info')
except Exception, e:
except Exception as e:
rev_id = 'Exception: %s' % (e,)
os_lang = '.'.join([x for x in locale.getdefaultlocale() if x])

Loading…
Cancel
Save