diff --git a/debug_toolbar/panels/logging.py b/debug_toolbar/panels/logging.py index f296fc882..a7252c2bb 100644 --- a/debug_toolbar/panels/logging.py +++ b/debug_toolbar/panels/logging.py @@ -78,6 +78,6 @@ def process_request(self, request): def generate_stats(self, request, response): records = collector.get_collection() - self._records[threading.currentThread()] = records + self._records[threading.current_thread()] = records collector.clear_collection() self.record_stats({"records": records}) diff --git a/debug_toolbar/panels/staticfiles.py b/debug_toolbar/panels/staticfiles.py index 9a15c0f28..ef6af5d3e 100644 --- a/debug_toolbar/panels/staticfiles.py +++ b/debug_toolbar/panels/staticfiles.py @@ -118,7 +118,7 @@ def process_request(self, request): def generate_stats(self, request, response): used_paths = collector.get_collection() - self._paths[threading.currentThread()] = used_paths + self._paths[threading.current_thread()] = used_paths self.record_stats( { diff --git a/debug_toolbar/utils.py b/debug_toolbar/utils.py index cc5d74477..41889872a 100644 --- a/debug_toolbar/utils.py +++ b/debug_toolbar/utils.py @@ -252,14 +252,14 @@ def get_collection(self, thread=None): is provided, returns a list for the current thread. """ if thread is None: - thread = threading.currentThread() + thread = threading.current_thread() if thread not in self.collections: self.collections[thread] = [] return self.collections[thread] def clear_collection(self, thread=None): if thread is None: - thread = threading.currentThread() + thread = threading.current_thread() if thread in self.collections: del self.collections[thread]