Skip to content

Commit f3363ec

Browse files
committed
reorder body_file.close()
1 parent dbdd78c commit f3363ec

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

django/core/handlers/asgi.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,14 +233,15 @@ async def process_request(request, send):
233233
except asyncio.CancelledError:
234234
# Task re-raised the CancelledError as expected.
235235
pass
236-
body_file.close()
237236

238237
try:
239238
response = get_response_task.result()
240239
await sync_to_async(response.close)()
241240
except asyncio.CancelledError:
242241
await signals.request_finished.asend(sender=self.__class__)
243242

243+
body_file.close()
244+
244245
async def listen_for_disconnect(self, receive):
245246
"""Listen for disconnect from the client."""
246247
message = await receive()

0 commit comments

Comments
 (0)