Skip to content

Commit c341d54

Browse files
committed
Add support Python 3.9
1 parent 28b3361 commit c341d54

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

src/future/backports/xmlrpc/client.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,11 @@
134134
from future.builtins import bytes, dict, int, range, str
135135

136136
import base64
137-
# Py2.7 compatibility hack
138-
base64.encodebytes = base64.encodestring
139-
base64.decodebytes = base64.decodestring
140137
import sys
138+
if sys.version_info < (3, 9):
139+
# Py2.7 compatibility hack
140+
base64.encodebytes = base64.encodestring
141+
base64.decodebytes = base64.decodestring
141142
import time
142143
from datetime import datetime
143144
from future.backports.http import client as http_client

src/future/moves/_dummy_thread.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
from future.utils import PY3
33

44
if PY3:
5-
from _dummy_thread import *
5+
try:
6+
from _dummy_thread import *
7+
except ImportError:
8+
from _thread import *
69
else:
710
__future_module__ = True
811
from dummy_thread import *

src/future/standard_library/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
# 'Tkinter': 'tkinter',
126126
'_winreg': 'winreg',
127127
'thread': '_thread',
128-
'dummy_thread': '_dummy_thread',
128+
'dummy_thread': '_dummy_thread' if sys.version_info < (3, 9) else '_thread',
129129
# 'anydbm': 'dbm', # causes infinite import loop
130130
# 'whichdb': 'dbm', # causes infinite import loop
131131
# anydbm and whichdb are handled by fix_imports2

0 commit comments

Comments
 (0)