Skip to content

Commit

Permalink
t
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl committed Nov 26, 2024
1 parent 9783bdc commit 27a40d2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python/sdist/amici/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"""

import contextlib
import datetime
import importlib
import os
import re
Expand Down Expand Up @@ -218,11 +219,14 @@ def import_model_module(
t_imported = m.get_import_time()
t_modified = os.path.getmtime(m.__file__)
if t_imported < t_modified:
t_imp_str = datetime.datetime.fromtimestamp(t_imported).isoformat()
t_mod_str = datetime.datetime.fromtimestamp(t_modified).isoformat()
raise RuntimeError(
f"Cannot import extension for {module_name} from "
f"{module_path}, because an extension in the same location "
f"has already been imported, but the file was modified on "
"disk. Import the module with a different name or restart the "
f"disk. \nImported at {t_imp_str}\nModified at {t_mod_str}.\n"
"Import the module with a different name or restart the "
"Python kernel."
)

Expand Down

0 comments on commit 27a40d2

Please sign in to comment.