Skip to content

Commit

Permalink
Merge pull request #3 from w3c/jgraham/pickle_fixup
Browse files Browse the repository at this point in the history
Forgot the case where __cached_properties__ doesn't exist.
  • Loading branch information
jgraham committed Apr 10, 2015
2 parents 0282a0f + af21a25 commit a61ce89
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions manifest/sourcefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,13 @@ def __init__(self, tests_root, rel_path, url_base, use_committed=False):
def __getstate__(self):
# Remove computed properties if we pickle this class
rv = self.__dict__.copy()
for key in rv.keys():
if key in rv["__cached_properties__"]:
del rv[key]
del rv["__cached_properties__"]

if "__cached_properties__" in rv:
cached_properties = rv["__cached_properties__"]
for key in rv.keys():
if key in cached_properties:
del rv[key]
del rv["__cached_properties__"]
return rv

def name_prefix(self, prefix):
Expand Down

0 comments on commit a61ce89

Please sign in to comment.