This code isn't used as present: the actual objects we use and which get pickled are either static subclasses of ConfigToolDependency, or special purpos subclasses of Dependency which get attributes copied from an instance of a dynamic subclass of ConfigToolDependency which is then discarded. This is fortunate, as it doesn't work: the pickled reduction is a call to the dynamic subclass's constructor, but the superclass constructors rely on the environment object being fully initialized, which hasn't happened yet during unpickling. Avoid this by having a pickled reduction which is just a call to create the dynamic subclass object, and relying on the default __setstate__ behavior to unpickle the object's __dict__.pull/2926/head
parent
8efdcca930
commit
153a7fb332
1 changed files with 6 additions and 3 deletions
Loading…
Reference in new issue