make sure path is string

This commit is contained in:
Jakub Trllo 2024-04-11 10:10:55 +02:00
parent 4fa9cab65b
commit 93d0e28a63

View file

@ -225,6 +225,8 @@ def import_filepath(path: Path, module_name: Optional[str] = None):
if not module_name:
module_name = os.path.splitext(path.name)[0]
# Convert to string
path = str(path)
module = types.ModuleType(module_name)
module.__file__ = path