From 9e6b66c499173a0523ef933a122b1a71801b0dfd Mon Sep 17 00:00:00 2001 From: "A. Jesse Jiryu Davis" Date: Sat, 30 Jan 2016 12:51:51 -0500 Subject: [PATCH] PYTHON-1050 Rare RuntimeError during shutdown. --- pymongo/periodic_executor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pymongo/periodic_executor.py b/pymongo/periodic_executor.py index 8b7015b3f..68add5ed4 100644 --- a/pymongo/periodic_executor.py +++ b/pymongo/periodic_executor.py @@ -79,8 +79,8 @@ class PeriodicExecutor(object): if self._thread is not None: try: self._thread.join(timeout) - except ReferenceError: - # Thread already terminated. + except (ReferenceError, RuntimeError): + # Thread already terminated, or not yet started. pass def wake(self):