Paths are the default for modules

This commit is contained in:
Dave Halter
2021-01-14 02:00:14 +01:00
parent 7555dc0d45
commit 47d0318fa6
2 changed files with 2 additions and 2 deletions

View File

@@ -148,7 +148,7 @@ class ModuleValue(ModuleMixin, TreeValue):
if file_io is None:
self._path: Optional[Path] = None
else:
self._path = Path(file_io.path)
self._path = file_io.path
self.string_names = string_names # Optional[Tuple[str, ...]]
self.code_lines = code_lines
self._is_package = is_package

View File

@@ -412,7 +412,7 @@ def module_injector():
def module_injector(inference_state, names, code):
assert isinstance(names, tuple)
file_io = KnownContentFileIO(
Path('/foo/bar/module-injector-%s.py' % next(counter)),
Path('foo/bar/module-injector-%s.py' % next(counter)).absolute(),
code
)
v = _load_python_module(inference_state, file_io, names)