mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 05:54:25 +08:00
Paths are the default for modules
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user