From 6d2e8c823715e60c8c58bd00de662092ac959594 Mon Sep 17 00:00:00 2001 From: Daniel Kutik Date: Fri, 25 Nov 2022 08:45:37 +0100 Subject: [PATCH] Resolved DeprecationWarning for currentThread() In Python 3.10 onwards we see a DeprecationWarning: currentThread() is deprecated, use current_thread() instead. Same goes for getName(), replaced by name attribute. Test: tox (python 3.6 - 3.10) Signed-off-by: Daniel Kutik Change-Id: I80ec819752a5276cff3b2dadba0ec10cc92d09a4 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/353018 Reviewed-by: Mike Frysinger --- git_trace2_event_log.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git_trace2_event_log.py b/git_trace2_event_log.py index 7426aba9..2edab0e1 100644 --- a/git_trace2_event_log.py +++ b/git_trace2_event_log.py @@ -110,7 +110,7 @@ class EventLog(object): return { 'event': event_name, 'sid': self._full_sid, - 'thread': threading.currentThread().getName(), + 'thread': threading.current_thread().name, 'time': datetime.datetime.utcnow().isoformat() + 'Z', }