Skip to content

Commit a61ce89

Browse files
committed
Merge pull request #3 from w3c/jgraham/pickle_fixup
Forgot the case where __cached_properties__ doesn't exist.
2 parents 0282a0f + af21a25 commit a61ce89

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

manifest/sourcefile.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,13 @@ def __init__(self, tests_root, rel_path, url_base, use_committed=False):
4949
def __getstate__(self):
5050
# Remove computed properties if we pickle this class
5151
rv = self.__dict__.copy()
52-
for key in rv.keys():
53-
if key in rv["__cached_properties__"]:
54-
del rv[key]
55-
del rv["__cached_properties__"]
52+
53+
if "__cached_properties__" in rv:
54+
cached_properties = rv["__cached_properties__"]
55+
for key in rv.keys():
56+
if key in cached_properties:
57+
del rv[key]
58+
del rv["__cached_properties__"]
5659
return rv
5760

5861
def name_prefix(self, prefix):

0 commit comments

Comments
 (0)