mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-03-16 22:10:26 +00:00
Replace deprecated threading.currentThread()
This commit is contained in:
parent
054a583b79
commit
99c77b2b27
2 changed files with 3 additions and 3 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue