Skip to content

Commit ae9aac4

Browse files
Copilotogrisel
andcommitted
Also handle __annotate_func__ for Python 3.14 compatibility
Add removal of __annotate_func__ in addition to __annotate__ to ensure compatibility with Python 3.14 where both attribute names may be present. Co-authored-by: ogrisel <89061+ogrisel@users.noreply.github.com>
1 parent baf9548 commit ae9aac4

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

cloudpickle/cloudpickle.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,8 @@ def _class_getstate(obj):
758758
# namespace. We don't need to pickle it as Python will regenerate it from
759759
# __annotations__ when the class is reconstructed.
760760
clsdict.pop("__annotate__", None)
761+
# Also handle __annotate_func__ which may appear in some Python 3.14 builds
762+
clsdict.pop("__annotate_func__", None)
761763

762764
if issubclass(type(obj), abc.ABCMeta):
763765
# If obj is an instance of an ABCMeta subclass, don't pickle the

0 commit comments

Comments
 (0)