Skip to content

Commit 9c18d6f

Browse files
committed
uasyncio: test_http_server_heavy: Close socket with "finally".
1 parent f81285f commit 9c18d6f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

uasyncio/benchmark/test_http_server_heavy.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@ def serve(reader, writer):
1818
yield from writer.awrite(s * 100)
1919
yield from writer.awrite(s * 400000)
2020
yield from writer.awrite("=== END ===")
21-
yield from writer.aclose()
2221
except OSError as e:
2322
if e.args[0] == errno.EPIPE:
2423
print("EPIPE")
2524
elif e.args[0] == errno.ECONNRESET:
2625
print("ECONNRESET")
2726
else:
2827
raise
28+
finally:
29+
yield from writer.aclose()
2930

3031

3132
import logging

0 commit comments

Comments
 (0)