From 27a40d23f58a0b7b562e20591c66a25418a11ed8 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Tue, 26 Nov 2024 09:11:03 +0100 Subject: [PATCH] t --- python/sdist/amici/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python/sdist/amici/__init__.py b/python/sdist/amici/__init__.py index 2e29bc17f7..1b6d789fdd 100644 --- a/python/sdist/amici/__init__.py +++ b/python/sdist/amici/__init__.py @@ -7,6 +7,7 @@ """ import contextlib +import datetime import importlib import os import re @@ -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." )