From 48ffe3cdef4548d094637a8187453f7492a90dab Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Tue, 7 Jan 2020 18:44:00 -0800 Subject: [PATCH] Point _dummy_thread to _thread on Python 3.9. Fixes #317. --- CHANGES | 4 ++++ documentation/index.rst | 3 ++- six.py | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 797169f85..3dda8d47c 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,10 @@ This file lists the changes in each six version. Development version ------------------- +- Issue #317: `six.moves._dummy_thread` now points to the `_thread` module on + Python 3.9+. Python 3.7 and later requires threading and deprecated the + `_dummy_thread` module. + - Issue #308, pull request #314: Remove support for Python 2.6 and Python 3.2. - Issue #250, issue #165, pull request #251: `six.wraps` now ignores missing diff --git a/documentation/index.rst b/documentation/index.rst index f4c90c9c1..e5e299428 100644 --- a/documentation/index.rst +++ b/documentation/index.rst @@ -591,7 +591,8 @@ Supported renames: +------------------------------+-------------------------------------+---------------------------------------+ | ``dbm_ndbm`` | :mod:`py2:dbm` | :mod:`py3:dbm.ndbm` | +------------------------------+-------------------------------------+---------------------------------------+ -| ``_dummy_thread`` | :mod:`py2:dummy_thread` | :mod:`py3:_dummy_thread` | +| ``_dummy_thread`` | :mod:`py2:dummy_thread` | :mod:`py3:_dummy_thread` (< 3.9) | +| | | :mod:`py3:_thread` (3.9+) | +------------------------------+-------------------------------------+---------------------------------------+ | ``email_mime_base`` | :mod:`py2:email.MIMEBase` | :mod:`py3:email.mime.base` | +------------------------------+-------------------------------------+---------------------------------------+ diff --git a/six.py b/six.py index ecca823b0..e7d2dc37c 100644 --- a/six.py +++ b/six.py @@ -259,7 +259,7 @@ class _MovedItems(_LazyModule): MovedModule("copyreg", "copy_reg"), MovedModule("dbm_gnu", "gdbm", "dbm.gnu"), MovedModule("dbm_ndbm", "dbm", "dbm.ndbm"), - MovedModule("_dummy_thread", "dummy_thread", "_dummy_thread"), + MovedModule("_dummy_thread", "dummy_thread", "_dummy_thread" if sys.version < (3, 9) else "_thread"), MovedModule("http_cookiejar", "cookielib", "http.cookiejar"), MovedModule("http_cookies", "Cookie", "http.cookies"), MovedModule("html_entities", "htmlentitydefs", "html.entities"),