Commit 9298678
committed
Fix dot-notation read on $@ref-backed ConfigParser proxies
_ConfigProxy.__getattr__ fell back to getattr(self._value, key) when the
chained config id was absent from the resolver. For a proxy backed by a
$@ref the children have no ids of their own, so parser.alias.x looked up
"x" as a dict *attribute* and raised AttributeError, even though
parser.alias["x"] resolved it and returned the value.
Resolve a key present in the underlying container the same way
__getitem__ already does, so dot- and bracket-notation agree on
ref-backed proxies and config keys keep precedence over dict methods, as
documented. Keys absent from the container still fall back to the
container's own attributes, so .keys()/.items() are unaffected.
Signed-off-by: VenkateswarluNagineni <venkates2002@tamu.edu>1 parent 3a458fe commit 9298678
2 files changed
Lines changed: 26 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | | - | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
166 | 173 | | |
167 | 174 | | |
168 | 175 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
487 | 487 | | |
488 | 488 | | |
489 | 489 | | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
490 | 508 | | |
491 | 509 | | |
492 | 510 | | |
| |||
0 commit comments