Merge pull request #733 from cjmayo/currentThread

Replace deprecated threading.currentThread()
This commit is contained in:
Chris Mayo 2023-04-25 19:21:58 +01:00 committed by GitHub
commit 6ac5ed4d57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -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()

View file

@ -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)