Skip to content

Commit

Permalink
[inferpython] fix sourcefile name
Browse files Browse the repository at this point in the history
Summary: The sourcefile name was of the form "dir1::dir2::file.py". It is now "dir1/dir2/file.py". The "::" are used when creating Textual class names where "." is reserved.

Reviewed By: martintrojer

Differential Revision: D66297797

fbshipit-source-id: d7da558bf456d6f9531dd0e9bf2e5f53f1c072d1
  • Loading branch information
davidpichardie authored and facebook-github-bot committed Nov 21, 2024
1 parent 1559182 commit 61c1eea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion infer/src/python/PyIR2Textual.ml
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,9 @@ let mk_procdesc proc_kind


let mk_module {Module.name; toplevel; functions} =
let filename = F.asprintf "%a.py" Ident.pp name (* TODO: may not work with nested paths *) in
let filename =
F.asprintf "%a.py" Ident.pp name |> String.substr_replace_all ~pattern:"::" ~with_:"/"
in
let sourcefile = Textual.SourceFile.create filename in
let decls =
List.map (QualName.Map.bindings functions) ~f:(fun (qual_name, cfg) ->
Expand Down

0 comments on commit 61c1eea

Please sign in to comment.