kopia lustrzana https://github.com/micropython/micropython-lib
uasyncio: test_http_server_heavy: Close socket with "finally".
rodzic
f81285ff4e
commit
9c18d6f39b
|
@ -18,7 +18,6 @@ def serve(reader, writer):
|
||||||
yield from writer.awrite(s * 100)
|
yield from writer.awrite(s * 100)
|
||||||
yield from writer.awrite(s * 400000)
|
yield from writer.awrite(s * 400000)
|
||||||
yield from writer.awrite("=== END ===")
|
yield from writer.awrite("=== END ===")
|
||||||
yield from writer.aclose()
|
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
if e.args[0] == errno.EPIPE:
|
if e.args[0] == errno.EPIPE:
|
||||||
print("EPIPE")
|
print("EPIPE")
|
||||||
|
@ -26,6 +25,8 @@ def serve(reader, writer):
|
||||||
print("ECONNRESET")
|
print("ECONNRESET")
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
|
finally:
|
||||||
|
yield from writer.aclose()
|
||||||
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
Ładowanie…
Reference in New Issue