﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
25779	Redundant try block in WSGIHandler	Attila Tovt	nobody	"In this code(https://github.com/django/django/blob/master/django/core/handlers/wsgi.py#L158-L165):
{{{#!python
                try:
                    # Check that middleware is still uninitialized.
                    if self._request_middleware is None:
                        self.load_middleware()
                except Exception:
                    # Unload whatever middleware we got
                    self._request_middleware = None
                    raise
}}}

It seems there is no need for this try block, because `self._request_middleware` is being used as a flag of successful initialization completion.
Here where it gets assigned(https://github.com/django/django/blob/master/django/core/handlers/base.py#L73-L75):
{{{#!python
        # We only assign to this when initialization is complete as it is used
        # as a flag for initialization being complete.
        self._request_middleware = request_middleware
}}}
Maybe, there are some thread safety issues that I'm missing, in which case, I'm sorry for bothering."	Cleanup/optimization	closed	Core (Other)	dev	Normal	fixed		Andrew Godwin	Accepted	1	0	0	0	0	0
