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 import pymssql
CONNECTORS.append(('mssql', 'Microsoft SQL Server')) CONNECTORS.append(('mssql', 'Microsoft SQL Server'))
assert pymssql assert pymssql
except ImportError, AssertionError:
except (ImportError, AssertionError):
_logger.info('MS SQL Server not available. Please install "pymssql"\ _logger.info('MS SQL Server not available. Please install "pymssql"\
python package.') python package.')
try: try:
import MySQLdb import MySQLdb
CONNECTORS.append(('mysql', 'MySQL')) CONNECTORS.append(('mysql', 'MySQL'))
assert MySQLdb assert MySQLdb
except ImportError, AssertionError:
except (ImportError, AssertionError):
_logger.info('MySQL not available. Please install "mysqldb"\ _logger.info('MySQL not available. Please install "mysqldb"\
python package.') python package.')
except: except:
@ -159,7 +159,7 @@ Sample connection strings:
conn = False conn = False
try: try:
conn = self.conn_open(cr, uid, obj.id) conn = self.conn_open(cr, uid, obj.id)
except Exception, e:
except Exception as e:
raise orm.except_orm(_("Connection test failed!"), raise orm.except_orm(_("Connection test failed!"),
_("Here is what we got instead:\n %s") _("Here is what we got instead:\n %s")
% tools.ustr(e)) % 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 '')) args = safe_eval('tuple(%s)' % (job['args'] or ''))
method(cr, job['user_id'], *args) 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 # User friendly error if the lock could not be claimed
if e.pgcode == '55P03': if e.pgcode == '55P03':
raise orm.except_orm( raise orm.except_orm(

2
server_environment/serv_config.py

@ -93,7 +93,7 @@ def _load_config():
config_p.optionxform = str config_p.optionxform = str
try: try:
config_p.read(conf_files) config_p.read(conf_files)
except Exception, e:
except Exception as e:
raise Exception('Cannot read config files "%s": %s' % (conf_files, e)) raise Exception('Cannot read config files "%s": %s' % (conf_files, e))
return config_p 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 # inspired by server/bin/service/web_services.py
try: try:
rev_id = _get_output('bzr revision-info') rev_id = _get_output('bzr revision-info')
except Exception, e:
except Exception as e:
rev_id = 'Exception: %s' % (e,) rev_id = 'Exception: %s' % (e,)
os_lang = '.'.join([x for x in locale.getdefaultlocale() if x]) os_lang = '.'.join([x for x in locale.getdefaultlocale() if x])

Loading…
Cancel
Save