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