fix cannot pickle 'Element' object: a class that defines __slots__ without…

fix cannot pickle 'Element' object: a class that defines __slots__ without defining __getstate__ cannot be pickled with protocol 1
üst 52ac26e6
......@@ -80,8 +80,11 @@ class LazyDB(Singleton):
f.write(LazyDB.cache_version)
f.flush()
os.fsync(f.fileno())
pickle.dump(self._instance().__dict__,
open(self.__cache_file(), 'wb'), 1)
try:
pickle.dump(self._instance().__dict__,
open(self.__cache_file(), 'wb'), 1)
except:
pass
ctx.ui.debug("LazyDB: {0} cached.".format(self.__class__.__name__))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment