Commit cb1622a
authored
pdo: Fix wrongfully returned object for missing index (#636)
The fallback behavior in PdoMaps.__getitem__() tried looking up by
parameter record index even when no com_offset or map_offset was
defined. This caused a possibly wrong PdoMap object to be
returned. For example with 0x15FF, the lookup for 0x1600 would
succeed.
Add a test to make sure that an nonexistant parameter record index for
0x15FF actually does raise a KeyError. Skip the fallback lookup by
parameter index if no record offsets are defined.1 parent 9685880 commit cb1622a
2 files changed
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
182 | 184 | | |
183 | 185 | | |
184 | 186 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
| |||
0 commit comments