Skip to content

threading.currentThread has been deprecated in favour of threading.current_thread in Python 3.10 #1144

Closed
@tirkarthi

Description

@tirkarthi

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:

  1. What version of Python are you using? CPython master branch
  2. What version of coverage.py are you using? The output of coverage debug sys is helpful.
  3. What versions of what packages do you have installed? The output of pip freeze is helpful.
  4. What code are you running? Give us a specific commit of a specific repo that we can check out.
  5. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions