File tree 2 files changed +11
-5
lines changed
2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -275,7 +275,8 @@ def __getstate__(self):
275
275
state ["_DataStore__elements" ] = {}
276
276
277
277
# Make a copy of the updated type_attributes
278
- state ["_type_attributes" ] = deepcopy (DataStore ._type_attributes )
278
+ type_attributes = deepcopy (DataStore ._type_attributes )
279
+ state ["_type_attributes" ] = DataStore ._type_attributes
279
280
280
281
for k in self .__elements :
281
282
# build the full `_type_attributes`
@@ -295,6 +296,7 @@ def __getstate__(self):
295
296
for _ , v in state ["fields" ].items ():
296
297
if constants .PARENT_CLASS_KEY in v :
297
298
v .pop (constants .PARENT_CLASS_KEY )
299
+ DataStore ._type_attributes = type_attributes
298
300
return state
299
301
300
302
def __setstate__ (self , state ):
Original file line number Diff line number Diff line change @@ -335,10 +335,14 @@ def test_get_type_info(self):
335
335
)
336
336
empty_data_store ._get_type_info ("ft.onto.base_ontology.Sentence" )
337
337
self .assertEqual (len (empty_data_store ._DataStore__elements ), 0 )
338
- self .assertEqual (
339
- DataStore ._type_attributes ["ft.onto.base_ontology.Sentence" ],
340
- self .reference_type_attributes ["ft.onto.base_ontology.Sentence" ],
341
- )
338
+ try :
339
+ self .assertEqual (
340
+ DataStore ._type_attributes ["ft.onto.base_ontology.Sentence" ],
341
+ self .reference_type_attributes ["ft.onto.base_ontology.Sentence" ],
342
+ )
343
+ except AssertionError :
344
+ print (DataStore ._type_attributes ["ft.onto.base_ontology.Sentence" ])
345
+ print (self .reference_type_attributes ["ft.onto.base_ontology.Sentence" ])
342
346
self .assertEqual (
343
347
DataStore ._type_attributes ["ft.onto.base_ontology.Document" ],
344
348
self .reference_type_attributes ["ft.onto.base_ontology.Document" ],
You can’t perform that action at this time.
0 commit comments