We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5bef368 + 4a729cf commit c89fc6eCopy full SHA for c89fc6e
src/pyshark/capture/capture.py
@@ -1,4 +1,5 @@
1
import asyncio
2
+import contextlib
3
import inspect
4
import os
5
import threading
@@ -402,7 +403,10 @@ async def close_async(self):
402
403
self._running_processes.clear()
404
405
# Wait for all stderr handling to finish
- await asyncio.gather(*self._stderr_handling_tasks)
406
+ for task in self._stderr_handling_tasks:
407
+ task.cancel()
408
+ with contextlib.suppress(asyncio.CancelledError):
409
+ await task
410
411
def __del__(self):
412
if self._running_processes:
0 commit comments