Skip to content

Commit c0f655e

Browse files
committed
Fix namespace packages JSON roundtrip
1 parent 171efbe commit c0f655e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/griffe/_internal/encoders.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,12 @@ def _attach_parent_to_exprs(obj: Class | Function | Attribute | TypeAlias, paren
192192

193193

194194
def _load_module(obj_dict: dict[str, Any]) -> Module:
195+
filepath = obj_dict.get("filepath")
196+
if filepath is not None:
197+
filepath = [*map(Path, filepath)] if isinstance(filepath, list) else Path(filepath)
195198
module = Module(
196199
name=obj_dict["name"],
197-
filepath=Path(obj_dict["filepath"]) if "filepath" in obj_dict else None,
200+
filepath=filepath,
198201
docstring=_load_docstring(obj_dict),
199202
runtime=obj_dict.get("runtime", True),
200203
analysis=obj_dict.get("analysis"),

0 commit comments

Comments
 (0)