Skip to content

Commit 0b06350

Browse files
Fix test_inheritance_pep563.
1 parent 7ba3de8 commit 0b06350

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

Lib/test/pickletester.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3239,7 +3239,7 @@ def test_builtin_exceptions(self):
32393239
self.assertIs(u, t)
32403240

32413241
def test_builtin_functions(self):
3242-
new_names = {'aiter': (3, 10), 'anext': (3, 10)}
3242+
new_names = {'breakpoint': (3, 7), 'aiter': (3, 10), 'anext': (3, 10)}
32433243
for t in builtins.__dict__.values():
32443244
if isinstance(t, types.BuiltinFunctionType):
32453245
if t.__name__ in new_names and self.py_version < new_names[t.__name__]:
@@ -3259,6 +3259,7 @@ def test_proto(self):
32593259
else:
32603260
self.assertEqual(count_opcode(pickle.PROTO, pickled), 0)
32613261

3262+
def test_bad_proto(self):
32623263
oob = protocols[-1] + 1 # a future protocol
32633264
build_none = pickle.NONE + pickle.STOP
32643265
badpickle = pickle.PROTO + bytes([oob]) + build_none

Lib/test/support/__init__.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
"""Supporting definitions for the Python regression tests."""
22

3-
from __future__ import annotations # for test_xpickle
4-
53
if __name__ != 'test.support':
64
raise ImportError('support must be imported from the test package')
75

@@ -271,7 +269,7 @@ class USEROBJECTFLAGS(ctypes.Structure):
271269
reason = "unable to detect macOS launchd job manager"
272270
else:
273271
if managername != "Aqua":
274-
reason = f"{managername=} -- can only run in a macOS GUI session"
272+
reason = f"{managername!r} -- can only run in a macOS GUI session"
275273

276274
# check on every platform whether tkinter can actually do anything
277275
if not reason:
@@ -803,7 +801,7 @@ def sortdict(dict):
803801
return "{%s}" % withcommas
804802

805803

806-
def run_code(code: str, extra_names: dict[str, object] | None = None) -> dict[str, object]:
804+
def run_code(code: str, extra_names: 'dict[str, object] | None' = None) -> 'dict[str, object]':
807805
"""Run a piece of code after dedenting it, and return its global namespace."""
808806
ns = {}
809807
if extra_names:
@@ -3053,7 +3051,7 @@ def new_setUpClass(cls):
30533051
return cls
30543052

30553053

3056-
def make_clean_env() -> dict[str, str]:
3054+
def make_clean_env() -> 'dict[str, str]':
30573055
clean_env = os.environ.copy()
30583056
for k in clean_env.copy():
30593057
if k.startswith("PYTHON"):

Lib/test/test_xpickle.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,9 @@ class CPicklePythonCompat(AbstractCompatTests):
231231
(3, 7): [
232232
# This version does not support buffers
233233
'test_in_band_buffers',
234+
235+
# No protocol validation in this version
236+
'test_bad_proto',
234237
],
235238
}
236239

0 commit comments

Comments
 (0)