Fixed wrong warning about pending I/O in Task destructor
This commit is contained in:
parent
727848ada8
commit
33feb442e4
|
@ -99,7 +99,6 @@ class AsyncStream:
|
||||||
await io_release(self.stream)
|
await io_release(self.stream)
|
||||||
self.stream.close()
|
self.stream.close()
|
||||||
self.stream = None
|
self.stream = None
|
||||||
await aiosched.checkpoint()
|
|
||||||
|
|
||||||
async def fileno(self):
|
async def fileno(self):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -142,5 +142,5 @@ class Task:
|
||||||
|
|
||||||
if not self.done():
|
if not self.done():
|
||||||
warnings.warn(f"task '{self.name}' was destroyed, but it has not completed yet")
|
warnings.warn(f"task '{self.name}' was destroyed, but it has not completed yet")
|
||||||
if self.last_io:
|
if self.last_io and self.last_io[1].fileno() != -1:
|
||||||
warnings.warn(f"task '{self.name}' was destroyed, but it has pending I/O")
|
warnings.warn(f"task '{self.name}' was destroyed, but it has pending I/O: forgot to close a resource?")
|
||||||
|
|
Reference in New Issue