File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change 1+ Convert import_root to a string if it was submitted as a Path object to ensure that anything added to sys.path is a string
Original file line number Diff line number Diff line change @@ -22,6 +22,10 @@ def import_module(
2222 if import_root and relative_path :
2323 file_on_disk = Path (import_root , relative_path , module_path .name )
2424
25+ # This is a temporary workaround for to account for issues if "import_root" is a Path instead of a str
26+ # Later we should rework this so that import_root and relative_path are all Path objects. Here we must
27+ # ensure that anything we add to sys.path is a string and not a Path or PosixPath object.
28+ import_root = str (import_root )
2529 if import_root not in sys .path :
2630 sys .path .append (import_root )
2731
You can’t perform that action at this time.
0 commit comments