diff options
author | Tristan van Berkom <tristan.vanberkom@codethink.co.uk> | 2020-06-15 17:15:02 +0900 |
---|---|---|
committer | Tristan van Berkom <tristan.vanberkom@codethink.co.uk> | 2020-06-15 19:11:12 +0900 |
commit | 5daa22ae6f60568849254274fdbf57bde5b919d8 (patch) | |
tree | 5e689c7d7bad75dfa7b3b15a2f726131830573a1 /src/buildstream/_pluginfactory | |
parent | 0c14551de6ff5c84e1689d544f2d3ee073ac0a07 (diff) | |
download | buildstream-5daa22ae6f60568849254274fdbf57bde5b919d8.tar.gz |
Completely abolish job pickling.tristan/nuke-pickle-jobber
Diffstat (limited to 'src/buildstream/_pluginfactory')
-rw-r--r-- | src/buildstream/_pluginfactory/pluginfactory.py | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/src/buildstream/_pluginfactory/pluginfactory.py b/src/buildstream/_pluginfactory/pluginfactory.py index 22f62427e..df950abee 100644 --- a/src/buildstream/_pluginfactory/pluginfactory.py +++ b/src/buildstream/_pluginfactory/pluginfactory.py @@ -92,39 +92,6 @@ class PluginFactory: searchpath=[self._site_plugins_path], identifier=self._identifier + "site", ) - def __getstate__(self): - state = self.__dict__.copy() - - # PluginSource is not a picklable type, so we must reconstruct this one - # as best we can when unpickling. - # - # Since the values of `_types` depend on the PluginSource, we must also - # get rid of those. It is only a cache - we will automatically recreate - # them on demand. - # - # Note that this method of referring to members is error-prone in that - # a later 'search and replace' renaming might miss these. Guard against - # this by making sure we are not creating new members, only clearing - # existing ones. - # - del state["_site_source"] - assert "_types" in state - state["_types"] = {} - assert "_sources" in state - state["_sources"] = {} - - return state - - def __setstate__(self, state): - self.__dict__.update(state) - - # Note that in order to enable plugins to be unpickled along with this - # PluginSource, we would also have to set and restore the 'identifier' - # of the PluginSource. We would also have to recreate `_types` as it - # was before unpickling them. We are not using this method in - # BuildStream, so the identifier is not restored here. - self._init_site_source() - ###################################################### # Public Methods # ###################################################### |