Skip to content

Commit 5dab566

Browse files
alexmalyshevmeta-codesync[bot]
authored andcommitted
Handle types/ and non types/ dirs
Summary: Not sure why, but I needed this change to get the pyrefly integration working. Reviewed By: martindemello Differential Revision: D97328153 fbshipit-source-id: a4732dbd4bf73c5d843a27679bbc6fa55e4a8604
1 parent 0682bb6 commit 5dab566

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

cinderx/PythonLib/cinderx/compiler/static/pyrefly_info.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,10 @@ class Pyrefly:
322322
"""Manages type information emitted by pyrefly."""
323323

324324
def __init__(self, type_dir: str) -> None:
325-
self.type_dir = type_dir
325+
# Buck always specifies the top-level directory, so double-check if there's a
326+
# types/ subdirectory and use that if it exists.
327+
types_subdir = os.path.join(type_dir, "types")
328+
self.type_dir = types_subdir if os.path.isdir(types_subdir) else type_dir
326329

327330
def load_type_info(self, module_name: str) -> PyreflyTypeInfo | None:
328331
if self.type_dir is None:

0 commit comments

Comments
 (0)