[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:
@@ -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):
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user