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):
4229
4229
def __ror__ (self , other ):
4230
4230
return typing .Union [other , self ]
4231
4231
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
+
4232
4237
def __reduce__ (self ):
4233
4238
"""Record where this sentinel is defined."""
4239
+ # Avoid self.__class__ to ensure pickle data does not get locked to a subclass
4234
4240
return (
4235
- Sentinel , # Ensure pickle data does not get locked to a subclass
4241
+ Sentinel . _unpickle_fetch_sentinel ,
4236
4242
( # Only the location of the sentinel needs to be stored
4237
4243
self ._name ,
4238
4244
self ._module_name ,
You can’t perform that action at this time.
0 commit comments