Closed
Description
Describe the bug
threading.currentThread has been deprecated in favour of threading.current_thread in Python 3.10 . current_thread is also available in Python 2.7
To Reproduce
How can we reproduce the problem? Please be specific. Don't just link to a failing CI job. Answer the questions below:
- What version of Python are you using? CPython master branch
- What version of coverage.py are you using? The output of
coverage debug sys
is helpful. - What versions of what packages do you have installed? The output of
pip freeze
is helpful. - What code are you running? Give us a specific commit of a specific repo that we can check out.
- What commands did you run?
rg -t py -w 'currentThread|notifyAll|activeCount|getName|setName|isDaemon|setDaemon'
tests/test_concurrency.py
521: ident = threading.currentThread().ident
coverage/pytracer.py
88: self.threading.currentThread().ident,
223: self.thread = self.threading.currentThread()
225: if self.thread.ident != self.threading.currentThread().ident:
246: if self.threading and self.thread.ident != self.threading.currentThread().ident:
Expected behavior
currentThread needs to be replaced with current_thread which is also available in Python 2.7
Additional context
CPython PR : python/cpython#25174