Show More
@@ -118,6 +118,11 b' class Config(dict):' | |||
|
118 | 118 | return type(self)(copy.deepcopy(self.items())) |
|
119 | 119 | |
|
120 | 120 | def __getitem__(self, key): |
|
121 | # We cannot use directly self._is_section_key, because it triggers | |
|
122 | # infinite recursion on top of PyPy. Instead, we manually fish the | |
|
123 | # bound method. | |
|
124 | is_section_key = self.__class__._is_section_key.__get__(self) | |
|
125 | ||
|
121 | 126 | # Because we use this for an exec namespace, we need to delegate |
|
122 | 127 | # the lookup of names in __builtin__ to itself. This means |
|
123 | 128 | # that you can't have section or attribute names that are |
@@ -126,7 +131,7 b' class Config(dict):' | |||
|
126 | 131 | return getattr(__builtin__, key) |
|
127 | 132 | except AttributeError: |
|
128 | 133 | pass |
|
129 |
if |
|
|
134 | if is_section_key(key): | |
|
130 | 135 | try: |
|
131 | 136 | return dict.__getitem__(self, key) |
|
132 | 137 | except KeyError: |
General Comments 0
You need to be logged in to leave comments.
Login now