Commit 5588c75
authored
[red-knot] Fix relative imports in
## Summary
Fixes #15989
Red Knot failed to resolve relative imports if the importing module is
located at a search path root.
The issue was that the module resolver returned an `Err(TooManyDots)` as
soon as the parent of the current module is `None` (which is the case
for a module at the search path root).
However, this is incorrect if a `tail` (a module name) exists.src.root (#15990)1 parent 9d2105b commit 5588c75
File tree
2 files changed
+50
-6
lines changed- crates/red_knot_python_semantic
- resources/mdtest/import
- src/types
2 files changed
+50
-6
lines changedLines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2513 | 2513 | | |
2514 | 2514 | | |
2515 | 2515 | | |
2516 | | - | |
| 2516 | + | |
2517 | 2517 | | |
| 2518 | + | |
2518 | 2519 | | |
2519 | | - | |
2520 | | - | |
2521 | | - | |
2522 | | - | |
| 2520 | + | |
| 2521 | + | |
| 2522 | + | |
| 2523 | + | |
| 2524 | + | |
| 2525 | + | |
| 2526 | + | |
| 2527 | + | |
| 2528 | + | |
| 2529 | + | |
| 2530 | + | |
| 2531 | + | |
| 2532 | + | |
| 2533 | + | |
| 2534 | + | |
| 2535 | + | |
2523 | 2536 | | |
| 2537 | + | |
2524 | 2538 | | |
2525 | | - | |
2526 | 2539 | | |
2527 | 2540 | | |
| 2541 | + | |
2528 | 2542 | | |
2529 | 2543 | | |
2530 | 2544 | | |
| |||
0 commit comments