Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl committed Nov 26, 2024
1 parent 8dcfa8b commit 9783bdc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions python/sdist/amici/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,14 @@ def import_model_module(
module_name,
f"_{module_name}{ext_suffix}",
)
if not needed_file.exists():
# if we import a matlab-generated model where the extension
# is in a different directory
needed_file = Path(
module_path,
f"_{module_name}{ext_suffix}",
)

if not loaded_file.samefile(needed_file):
# this is not the right module, and we can't unload it
raise RuntimeError(
Expand Down

0 comments on commit 9783bdc

Please sign in to comment.