[FIX] raise statements

In Python 3, `raise` can take:
* nothing (reraises)
* an exception *instance*
* an exception instance `from` a traceback

The Python 2 forms `raise type, instance` and
`raise type, instance, traceback` are deprecated and should be replaced.

Fixers:
    libfuturize.fixes.fix_raise

#8530
This commit is contained in:
Xavier Morel
2017-04-24 11:08:49 +02:00
parent 54a90ca919
commit e8013fb887
2 changed files with 3 additions and 3 deletions
@@ -25,7 +25,7 @@ class AccountCommonReport(models.TransientModel):
return result
def _print_report(self, data):
raise (_('Error!'), _('Not implemented.'))
raise NotImplementedError()
@api.multi
def check_report(self):
+2 -2
View File
@@ -141,6 +141,6 @@ def exp_report_get(db, uid, report_id):
if self_reports[report_id]['uid'] == uid:
return _check_report(report_id)
else:
raise Exception, 'AccessDenied'
raise Exception('AccessDenied')
else:
raise Exception, 'ReportNotFound'
raise Exception('ReportNotFound')