diff --git a/aiosched/io.py b/aiosched/io.py index d48c79e..92323eb 100644 --- a/aiosched/io.py +++ b/aiosched/io.py @@ -99,7 +99,6 @@ class AsyncStream: await io_release(self.stream) self.stream.close() self.stream = None - await aiosched.checkpoint() async def fileno(self): """ diff --git a/aiosched/task.py b/aiosched/task.py index b669686..ee65683 100644 --- a/aiosched/task.py +++ b/aiosched/task.py @@ -142,5 +142,5 @@ class Task: if not self.done(): warnings.warn(f"task '{self.name}' was destroyed, but it has not completed yet") - if self.last_io: - warnings.warn(f"task '{self.name}' was destroyed, but it has pending I/O") + 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: forgot to close a resource?")