Skip to content

Commit a3b5915

Browse files
committed
compatibility of file loading with current compas_rhino
1 parent 2f80bc0 commit a3b5915

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
### Changed
1313

14+
* Changed `compas_session.lazyload.LazyLoadSession.get(..., filepath=...)` to convert path to a string before passing on to the constructors for compatibility with Rhino.
15+
1416
### Removed
1517

1618

src/compas_session/lazyload.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,15 +279,15 @@ def get(self, key: str, default: Any = None, filepath: Optional[pathlib.Path] =
279279
280280
"""
281281
if key not in self.data:
282-
filepath = filepath or self.datadir / f"{key}.json"
282+
filepath = pathlib.Path(filepath or self.datadir / f"{key}.json")
283283

284284
if filepath.exists():
285285
if filepath.suffix == ".obj":
286286
raise NotImplementedError
287287
elif filepath.suffix == ".stp":
288-
value = Brep.from_step(filepath)
288+
value = Brep.from_step(str(filepath))
289289
elif filepath.suffix == ".json":
290-
value = compas.json_load(filepath)
290+
value = compas.json_load(str(filepath))
291291
else:
292292
raise NotImplementedError
293293

0 commit comments

Comments
 (0)