[pickle] Fix value of pickle.DEFAULT_PROTOCOL for Python <3.14 (#15446)

This commit is contained in:
Brian Schubert
2026-02-21 13:03:39 -05:00
committed by GitHub
parent 9a06cb6c16
commit a3d69472e2
+5 -1
View File
@@ -1,3 +1,4 @@
import sys
from _pickle import (
PickleError as PickleError,
Pickler as Pickler,
@@ -103,7 +104,10 @@ __all__ = [
]
HIGHEST_PROTOCOL: Final = 5
DEFAULT_PROTOCOL: Final = 5
if sys.version_info >= (3, 14):
DEFAULT_PROTOCOL: Final = 5
else:
DEFAULT_PROTOCOL: Final = 4
bytes_types: tuple[type[Any], ...] # undocumented