Merge pull request #576 from blueyed/fix-mypy

Move assignments to help mypy
This commit is contained in:
Tom Christie 2019-07-14 08:26:00 +01:00 committed by GitHub
commit 8aecc4e2e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 7 deletions

View File

@ -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: