diff --git a/pymongo/periodic_executor.py b/pymongo/periodic_executor.py index f51a988728..9b10f6e7e3 100644 --- a/pymongo/periodic_executor.py +++ b/pymongo/periodic_executor.py @@ -75,8 +75,6 @@ def close(self, dummy: Any = None) -> None: callback; see monitor.py. """ self._stopped = True - if self._task is not None: - self._task.cancel() async def join(self, timeout: Optional[int] = None) -> None: if self._task is not None: