We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5fcc5c7 commit c226b4fCopy full SHA for c226b4f
pymongo/periodic_executor.py
@@ -135,16 +135,16 @@ def _shutdown_executors():
135
136
# First signal all executors to close...
137
for ref in executors:
138
- try:
139
- ref().close()
140
- except ReferenceError:
141
- pass
+ executor = ref()
+ if executor:
+ executor.close()
142
143
# ...then try to join them.
144
145
146
- ref().join(1)
147
148
+ executor.join(1)
+
+ executor = None
149
150
atexit.register(_shutdown_executors)
0 commit comments