Repository navigation
Commit 9d97d07
[Backport maintenance/4.3.x] Fix crash when inferring Class.__bases__ without a parent (#3326)
Fix crash when inferring Class.__bases__ without a parent (#3319)
ClassModel.attr___bases__ returned a Tuple with no parent, so
NodeNG.root() raised AssertionError (e.g. pylint stdlib checker on
C.__bases__()). Parent the Tuple to the class, matching __mro__.
Refs pylint-dev/pylint#11491
(cherry picked from commit 8580761)
Co-authored-by: 00200200 <[email protected]>1 parent 0698518 commit 9d97d07
3 files changed
Lines changed: 24 additions & 1 deletion
File tree
- astroid/interpreter
- doc/whatsnew/fragments
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
596 | 596 | | |
597 | 597 | | |
598 | 598 | | |
599 | | - | |
| 599 | + | |
600 | 600 | | |
601 | 601 | | |
602 | 602 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| 242 | + | |
| 243 | + | |
242 | 244 | | |
243 | 245 | | |
244 | 246 | | |
| |||
251 | 253 | | |
252 | 254 | | |
253 | 255 | | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
254 | 274 | | |
255 | 275 | | |
256 | 276 | | |
| |||
0 commit comments