diff options
| author | Xavier Morel <xmo@odoo.com> | 2017-04-11 12:44:29 +0200 |
|---|---|---|
| committer | Xavier Morel <xmo@odoo.com> | 2017-04-11 14:53:29 +0200 |
| commit | 3979f6802eeea275f949d28ddf4c18f84fc0f5aa (patch) | |
| tree | 0c67d60c80b2ece2e452837c187a79e9444334d8 /odoo/http.py | |
| parent | ca74b5e1c8a48bcdeb396625ec0d8028a5a9d5f1 (diff) | |
[#8530] convert exception handlers to except..as syntax
Futurize fixers:
* lib2to3.fixes.fix_except
Diffstat (limited to 'odoo/http.py')
| -rw-r--r-- | odoo/http.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/odoo/http.py b/odoo/http.py index cef63e8f639..015c00342b4 100644 --- a/odoo/http.py +++ b/odoo/http.py @@ -131,11 +131,11 @@ def dispatch_rpc(service_name, method, params): return result except NO_POSTMORTEM: raise - except odoo.exceptions.DeferredException, e: + except odoo.exceptions.DeferredException as e: _logger.exception(odoo.tools.exception_to_unicode(e)) odoo.tools.debugger.post_mortem(odoo.tools.config, e.traceback) raise - except Exception, e: + except Exception as e: _logger.exception(odoo.tools.exception_to_unicode(e)) odoo.tools.debugger.post_mortem(odoo.tools.config, sys.exc_info()) raise @@ -687,7 +687,7 @@ class JsonRequest(WebRequest): rpc_request.debug(logline) return self._json_response(result) - except Exception, e: + except Exception as e: return self._handle_exception(e) def serialize_exception(e): @@ -777,7 +777,7 @@ class HttpRequest(WebRequest): 'redirect': redirect, }) return werkzeug.utils.redirect('/web/login?%s' % query) - except werkzeug.exceptions.HTTPException, e: + except werkzeug.exceptions.HTTPException as e: return e def dispatch(self): @@ -1391,7 +1391,7 @@ class Root(object): if isinstance(result, Response) and result.is_qweb: try: result.flatten() - except(Exception), e: + except(Exception) as e: if request.db: result = request.registry['ir.http']._handle_exception(e) else: @@ -1448,7 +1448,7 @@ class Root(object): def _dispatch_nodb(): try: func, arguments = self.nodb_routing_map.bind_to_environ(request.httprequest.environ).match() - except werkzeug.exceptions.HTTPException, e: + except werkzeug.exceptions.HTTPException as e: return request._handle_exception(e) request.set_handler(func, arguments, "none") result = request.dispatch() @@ -1483,7 +1483,7 @@ class Root(object): response = self.get_response(httprequest, result, explicit_session) return response(environ, start_response) - except werkzeug.exceptions.HTTPException, e: + except werkzeug.exceptions.HTTPException as e: return e(environ, start_response) def get_db_router(self, db): |
