Skip to content

Commit

Permalink
[Python] Fix fable-compiler#3481: Resolve also paths for non-qualifie…
Browse files Browse the repository at this point in the history
…d imports
  • Loading branch information
alfonsogarciacaro committed Feb 6, 2025
1 parent f69cee1 commit f050742
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Fable.Transforms/Python/PythonPrinter.fs
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,12 @@ let run writer (program: Module) : Async<unit> =
| ImportFrom({ Module = Some(Identifier path) } as info) ->
let path = printer.MakeImportPath(path)
ImportFrom { info with Module = Some(Identifier path) }
| Import({ Names = names }) ->
let names =
names
|> List.map (fun n -> { n with Name = printer.MakeImportPath(n.Name.Name) |> Identifier })

Import { Names = names }
| decl -> decl
|> printDeclWithExtraLine false printer

Expand Down

0 comments on commit f050742

Please sign in to comment.