Show More
@@ -78,7 +78,7 b' class lazymap:' | |||
|
78 | 78 | self.p = parser |
|
79 | 79 | def load(self, key): |
|
80 | 80 | n = self.p.data.find(key) |
|
81 | if n < 0: raise KeyError(key) | |
|
81 | if n < 0: raise KeyError("node " + hex(key)) | |
|
82 | 82 | pos = n / self.p.s |
|
83 | 83 | self.p.load(pos) |
|
84 | 84 | def __contains__(self, key): |
@@ -91,8 +91,11 b' class lazymap:' | |||
|
91 | 91 | try: |
|
92 | 92 | return self.p.map[key] |
|
93 | 93 | except KeyError: |
|
94 |
|
|
|
95 |
|
|
|
94 | try: | |
|
95 | self.load(key) | |
|
96 | return self.p.map[key] | |
|
97 | except KeyError: | |
|
98 | raise KeyError("node " + hex(key)) | |
|
96 | 99 | def __setitem__(self, key, val): |
|
97 | 100 | self.p.map[key] = val |
|
98 | 101 |
General Comments 0
You need to be logged in to leave comments.
Login now