Skip to content

Commit 7101adb

Browse files
Partially support 3.5.
1 parent 1ab1203 commit 7101adb

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

Lib/test/pickletester.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3219,11 +3219,14 @@ def test_builtin_types(self):
32193219
self.assertIs(self.loads(s), t)
32203220

32213221
def test_builtin_exceptions(self):
3222-
new_names = {'EncodingWarning': (3, 10),
3223-
'BaseExceptionGroup': (3, 11),
3224-
'ExceptionGroup': (3, 11),
3225-
'_IncompleteInputError': (3, 13),
3226-
'PythonFinalizationError': (3, 13)}
3222+
new_names = {
3223+
'ModuleNotFoundError': (3, 6),
3224+
'EncodingWarning': (3, 10),
3225+
'BaseExceptionGroup': (3, 11),
3226+
'ExceptionGroup': (3, 11),
3227+
'_IncompleteInputError': (3, 13),
3228+
'PythonFinalizationError': (3, 13),
3229+
}
32273230
for t in builtins.__dict__.values():
32283231
if isinstance(t, type) and issubclass(t, BaseException):
32293232
if t.__name__ in new_names and self.py_version < new_names[t.__name__]:

Lib/test/test_xpickle.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This test covers backwards compatibility with
2-
# previous version of Python by bouncing pickled objects through Python 3.6
3-
# and Python 3.9 by running xpickle_worker.py.
2+
# previous version of Python by bouncing pickled objects through Python 3.5
3+
# and the current version by running xpickle_worker.py.
44
import io
55
import os
66
import pickle
@@ -68,7 +68,7 @@ def have_python_version(py_version):
6868
if py_version not in py_executable_map:
6969
for target in targets[0 if is_windows else 1:]:
7070
try:
71-
worker = subprocess.Popen([*target, '-c','import test.support'],
71+
worker = subprocess.Popen([*target, '-c', 'pass'],
7272
stdout=subprocess.DEVNULL,
7373
stderr=subprocess.DEVNULL,
7474
shell=is_windows)
@@ -246,7 +246,7 @@ def make_test(py_version, base):
246246
def load_tests(loader, tests, pattern):
247247
major = sys.version_info.major
248248
assert major == 3
249-
for minor in range(sys.version_info.minor):
249+
for minor in range(5, sys.version_info.minor):
250250
test_class = make_test((major, minor), PyPicklePythonCompat)
251251
tests.addTest(loader.loadTestsFromTestCase(test_class))
252252
if has_c_implementation:

0 commit comments

Comments
 (0)