diff --git a/pytools/__init__.py b/pytools/__init__.py index cd248487a3ef9515c8c0055edeb5fef965b66aa7..3d03cfa3522c52d15e3e28d77dee7cc0c260edac 100644 --- a/pytools/__init__.py +++ b/pytools/__init__.py @@ -2104,10 +2104,14 @@ class ProcessLogger(object): self.time_start = timeit.default_timer() import threading - self.late_start_log_thread = threading.Thread(target=self.log_start_if_long) + self.late_start_log_thread = threading.Thread(target=self._log_start_if_long) + + # Do not delay interpreter exit if thread not finished. + self.late_start_log_thread.daemon = True + self.late_start_log_thread.start() - def log_start_if_long(self): + def _log_start_if_long(self): from time import sleep sleep_duration = 10*self.long_threshold_seconds