From 99c77b2b2782339397f23faa170a26376ce9c195 Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Mon, 17 Apr 2023 19:28:14 +0100 Subject: [PATCH] Replace deprecated threading.currentThread() --- linkcheck/lock.py | 4 ++-- linkcheck/trace.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/linkcheck/lock.py b/linkcheck/lock.py index e747872a..44687e28 100644 --- a/linkcheck/lock.py +++ b/linkcheck/lock.py @@ -45,14 +45,14 @@ class DebugLock: def acquire(self, blocking=1): """Acquire lock.""" - threadname = threading.currentThread().name + threadname = threading.current_thread().name log.debug(LOG_THREAD, "Acquire %s for %s", self.name, threadname) self.lock.acquire(blocking) log.debug(LOG_THREAD, "...acquired %s for %s", self.name, threadname) def release(self): """Release lock.""" - threadname = threading.currentThread().name + threadname = threading.current_thread().name log.debug(LOG_THREAD, "Release %s for %s", self.name, threadname) self.lock.release() diff --git a/linkcheck/trace.py b/linkcheck/trace.py index e8dc8f44..c39bb2a9 100644 --- a/linkcheck/trace.py +++ b/linkcheck/trace.py @@ -75,7 +75,7 @@ def _trace_line(frame, event, arg): if filename.endswith((".pyc", ".pyo")): filename = filename[:-1] line = linecache.getline(filename, lineno) - currentThread = threading.currentThread() + currentThread = threading.current_thread() tid = currentThread.ident tname = currentThread.name args = (tid, tname, time.time(), line.rstrip(), name, lineno)