Implement tree-shaking for Python sources

This commit is contained in:
Justine Tunney 2021-09-05 01:20:03 -07:00
parent 81287b7ec0
commit 44c87b83ff
110 changed files with 899 additions and 1922 deletions

View file

@ -1,6 +1,6 @@
import collections
import copyreg
import dbm
# import dbm
import io
import functools
import pickle
@ -979,7 +979,7 @@ class AbstractUnpickleTests(unittest.TestCase):
self.assertIs(self.loads(pickled), functools.reduce)
# whichdb.whichdb
pickled = b'\x80\x02cwhichdb\nwhichdb\n.'
self.assertIs(self.loads(pickled), dbm.whichdb)
# self.assertIs(self.loads(pickled), dbm.whichdb)
# Exception(), StandardError()
for name in (b'Exception', b'StandardError'):
pickled = (b'\x80\x02cexceptions\n' + name + b'\nU\x03ugh\x85R.')
@ -2257,7 +2257,7 @@ class AbstractPickleTests(unittest.TestCase):
(range(1, 7), '__builtin__', 'xrange'),
(map(int, '123'), 'itertools', 'imap'),
(functools.reduce, '__builtin__', 'reduce'),
(dbm.whichdb, 'whichdb', 'whichdb'),
# (dbm.whichdb, 'whichdb', 'whichdb'),
(Exception(), 'exceptions', 'Exception'),
(collections.UserDict(), 'UserDict', 'IterableUserDict'),
(collections.UserList(), 'UserList', 'UserList'),

View file

@ -19,7 +19,10 @@ PORT = 0
SUPPORTS_SSL = False
if hasattr(poplib, 'POP3_SSL'):
import ssl
try:
import ssl
except ImportError:
assert False
SUPPORTS_SSL = True
CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir, "keycert3.pem")

View file

@ -23,8 +23,8 @@ try:
import ctypes
except ImportError:
ctypes = None
else:
import ctypes.util
# else:
# import ctypes.util
try:
import _thread