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

bpo-37312: Remove _dummy_thread and dummy_threading modules #14143

Merged
merged 1 commit into from
Jun 17, 2019
Merged

bpo-37312: Remove _dummy_thread and dummy_threading modules #14143

merged 1 commit into from
Jun 17, 2019

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Jun 17, 2019

Remove _dummy_thread and dummy_threading modules. These modules
were deprecated since Python 3.7 which requires threading support.

https://bugs.python.org/issue37312

Copy link
Member

@tirkarthi tirkarthi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two more references. It seems there is a fixer in 2to3 to convert dummy_thread to _dummy_thread. Since it's being removed I guess its good to remove the import related fixes too.

Lib/lib2to3/fixes/fix_imports.py:35:           'dummy_thread': '_dummy_thread',
Lib/_compat_pickle.py:31:    'dummy_thread': '_dummy_thread',

2to3 renames dummy_thread to _dummy_thread but running the fixed program with this PR throws ImportError

➜  cpython git:(pr_14143) cat /tmp/foo.py
import dummy_thread
➜  cpython git:(pr_14143) ./python.exe Tools/scripts/2to3 /tmp/foo.py
RefactoringTool: Skipping optional fixer: buffer
RefactoringTool: Skipping optional fixer: idioms
RefactoringTool: Skipping optional fixer: set_literal
RefactoringTool: Skipping optional fixer: ws_comma
RefactoringTool: Refactored /tmp/foo.py
--- /tmp/foo.py	(original)
+++ /tmp/foo.py	(refactored)
@@ -1 +1 @@
-import dummy_thread
+import _dummy_thread
RefactoringTool: Files that need to be modified:
RefactoringTool: /tmp/foo.py

@vstinner
Copy link
Member Author

There are two more references. It seems there is a fixer in 2to3 to convert dummy_thread to _dummy_thread.

Yep, I kept them on purpose. At least, it helps to make code compatible with Python 3.7.

Remove _dummy_thread and dummy_threading modules. These modules
were deprecated since Python 3.7 which requires threading support.
@vstinner
Copy link
Member Author

PR rebased to handle a conflict.

@vstinner vstinner merged commit 8bf08ee into python:master Jun 17, 2019
@vstinner vstinner deleted the remove_dummy_thread branch June 17, 2019 12:18
@vstinner
Copy link
Member Author

Thanks for the review @methane. Tests pass, I merged my PR.

lisroach pushed a commit to lisroach/cpython that referenced this pull request Sep 10, 2019
…-14143)

Remove _dummy_thread and dummy_threading modules. These modules
were deprecated since Python 3.7 which requires threading support.
DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
…-14143)

Remove _dummy_thread and dummy_threading modules. These modules
were deprecated since Python 3.7 which requires threading support.
arhadthedev added a commit to nirs/cpython that referenced this pull request May 22, 2023
I hope it will unblock the GitHub built-in merge resolver.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants