File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -4229,10 +4229,16 @@ def __or__(self, other):
42294229 def __ror__ (self , other ):
42304230 return typing .Union [other , self ]
42314231
4232+ @classmethod
4233+ def _unpickle_fetch_sentinel (cls , name : str , module_name : str ):
4234+ """Unpickle using the sentinels location."""
4235+ return cls (name , module_name )
4236+
42324237 def __reduce__ (self ):
42334238 """Record where this sentinel is defined."""
4239+ # Avoid self.__class__ to ensure pickle data does not get locked to a subclass
42344240 return (
4235- Sentinel , # Ensure pickle data does not get locked to a subclass
4241+ Sentinel . _unpickle_fetch_sentinel ,
42364242 ( # Only the location of the sentinel needs to be stored
42374243 self ._name ,
42384244 self ._module_name ,
You can’t perform that action at this time.
0 commit comments