Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Replace nested try/finally try/except with try/except/finally.

  • Loading branch information...
commit 9ca17f883d7a637581befe8092120242d0534673 1 parent 5e99a3d
@apollo13 apollo13 authored
Showing with 11 additions and 12 deletions.
  1. +11 −12 django/core/handlers/wsgi.py
View
23 django/core/handlers/wsgi.py
@@ -223,18 +223,17 @@ def __call__(self, environ, start_response):
set_script_prefix(base.get_script_name(environ))
signals.request_started.send(sender=self.__class__)
try:
- try:
- request = self.request_class(environ)
- except UnicodeDecodeError:
- logger.warning('Bad Request (UnicodeDecodeError)',
- exc_info=sys.exc_info(),
- extra={
- 'status_code': 400,
- }
- )
- response = http.HttpResponseBadRequest()
- else:
- response = self.get_response(request)
+ request = self.request_class(environ)
+ except UnicodeDecodeError:
+ logger.warning('Bad Request (UnicodeDecodeError)',
+ exc_info=sys.exc_info(),
+ extra={
+ 'status_code': 400,
+ }
+ )
+ response = http.HttpResponseBadRequest()
+ else:
+ response = self.get_response(request)
finally:
signals.request_finished.send(sender=self.__class__)
Please sign in to comment.
Something went wrong with that request. Please try again.