@@ -2532,37 +2532,6 @@ def str_to_node(self, s):
25322532 s = top .get_labspath () + '/' + s
25332533 return root ._lookup_abs (s , Entry )
25342534
2535- def __getstate__ (self ):
2536- """
2537- Return all fields that shall be pickled. Walk the slots in the class
2538- hierarchy and add those to the state dictionary. If a '__dict__' slot is
2539- available, copy all entries to the dictionary. Also include the version
2540- id, which is fixed for all instances of a class.
2541- """
2542- state = getattr (self , '__dict__' , {}).copy ()
2543- for obj in type (self ).mro ():
2544- for name in getattr (obj , '__slots__' , ()):
2545- if hasattr (self , name ):
2546- state [name ] = getattr (self , name )
2547-
2548- state ['_version_id' ] = self .current_version_id
2549- try :
2550- del state ['__weakref__' ]
2551- except KeyError :
2552- pass
2553-
2554- return state
2555-
2556- def __setstate__ (self , state ) -> None :
2557- """
2558- Restore the attributes from a pickled state.
2559- """
2560- # TODO check or discard version
2561- del state ['_version_id' ]
2562- for key , value in state .items ():
2563- if key not in ('__weakref__' ,):
2564- setattr (self , key , value )
2565-
25662535 def __eq__ (self , other ):
25672536 return self .csig == other .csig and self .timestamp == other .timestamp and self .size == other .size
25682537
0 commit comments