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 <daniel.kutik@lavawerk.com>
Change-Id: I80ec819752a5276cff3b2dadba0ec10cc92d09a4
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/353018
Reviewed-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
Daniel Kutik 2022-11-25 08:45:37 +01:00 committed by Mike Frysinger
parent a24185ee6c
commit 6d2e8c8237

View File

@ -110,7 +110,7 @@ class EventLog(object):
return { return {
'event': event_name, 'event': event_name,
'sid': self._full_sid, 'sid': self._full_sid,
'thread': threading.currentThread().getName(), 'thread': threading.current_thread().name,
'time': datetime.datetime.utcnow().isoformat() + 'Z', 'time': datetime.datetime.utcnow().isoformat() + 'Z',
} }