mirror of https://github.com/encode/starlette.git
Merge pull request #576 from blueyed/fix-mypy
Move assignments to help mypy
This commit is contained in:
commit
8aecc4e2e1
|
@ -154,6 +154,13 @@ class _ASGIAdapter(requests.adapters.HTTPAdapter):
|
|||
"extensions": {"http.response.template": {}},
|
||||
}
|
||||
|
||||
request_complete = False
|
||||
response_started = False
|
||||
response_complete = False
|
||||
raw_kwargs = {"body": io.BytesIO()} # type: typing.Dict[str, typing.Any]
|
||||
template = None
|
||||
context = None
|
||||
|
||||
async def receive() -> Message:
|
||||
nonlocal request_complete, response_complete
|
||||
|
||||
|
@ -218,13 +225,6 @@ class _ASGIAdapter(requests.adapters.HTTPAdapter):
|
|||
template = message["template"]
|
||||
context = message["context"]
|
||||
|
||||
request_complete = False
|
||||
response_started = False
|
||||
response_complete = False
|
||||
raw_kwargs = {"body": io.BytesIO()} # type: typing.Dict[str, typing.Any]
|
||||
template = None
|
||||
context = None
|
||||
|
||||
try:
|
||||
loop = asyncio.get_event_loop()
|
||||
except RuntimeError:
|
||||
|
|
Loading…
Reference in New Issue