Commit 55c1a63b authored by Chris Kelly's avatar Chris Kelly Committed by Joshua Roesslein
Browse files

catch exception for deleting _api model reference when pickling/ unpickling

parent d07ecd63
......@@ -19,7 +19,10 @@ class Model(object):
def __getstate__(self):
# pickle
pickle = dict(self.__dict__)
del pickle['_api'] # do not pickle the API reference
try:
del pickle['_api'] # do not pickle the API reference
except KeyError:
pass
return pickle
@classmethod
......
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