Skip to content

Commit f402c53

Browse files
Andrey Gavrilinbehackett
authored andcommitted
Fix up shutdown for periodic executors
1 parent 9ab7036 commit f402c53

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pymongo/periodic_executor.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ def _on_executor_deleted(ref):
126126

127127

128128
def _shutdown_executors():
129+
if _EXECUTORS is None:
130+
return
131+
129132
# Copy the set. Stopping threads has the side effect of removing executors.
130133
executors = list(_EXECUTORS)
131134

0 commit comments

Comments
 (0)