Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
tirkarthi opened this issue Apr 17, 2021 · 0 comments · Fixed by #1145
Labels
chore Routine maintenance fixed

Comments

@tirkarthi
Copy link
Contributor

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

@tirkarthi tirkarthi added the bug Something isn't working label Apr 17, 2021
@nedbat nedbat added chore Routine maintenance fixed and removed bug Something isn't working labels Apr 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Routine maintenance fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants