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.
--
Ticket URL: <https://code.djangoproject.com/ticket/25779>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* cc: andrewgodwin (added)
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
Andrew, I tracked that addition to the patch you committed in #11193
[ba585a2c6d]. Any insight?
--
Ticket URL: <https://code.djangoproject.com/ticket/25779#comment:1>
Comment (by charettes):
It looks like this change predates the use of context managers in Django.
--
Ticket URL: <https://code.djangoproject.com/ticket/25779#comment:2>
* stage: Unreviewed => Accepted
Comment:
The try block should probably have been removed during this commit:
[e0fce8706d31f]
--
Ticket URL: <https://code.djangoproject.com/ticket/25779#comment:3>
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/5693 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/25779#comment:4>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"8092745593e2aa7b54c6de44d12a893772ace3e9" 80927455]:
{{{
#!CommitTicketReference repository=""
revision="8092745593e2aa7b54c6de44d12a893772ace3e9"
Fixed #25779 -- Removed redundant try block in WSGIHandler
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25779#comment:5>