forked from VimPlug/jedi
Have all py__file__ methods return a Path
This commit is contained in:
@@ -5,6 +5,7 @@ import re
|
||||
from functools import partial
|
||||
from inspect import Parameter
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
|
||||
from jedi import debug
|
||||
from jedi.inference.utils import to_list
|
||||
@@ -305,11 +306,8 @@ class CompiledModule(CompiledValue):
|
||||
return ()
|
||||
return tuple(name.split('.'))
|
||||
|
||||
def py__file__(self):
|
||||
path = self.access_handle.py__file__()
|
||||
if path is None:
|
||||
return None
|
||||
return Path(path)
|
||||
def py__file__(self) -> Optional[Path]:
|
||||
return self.access_handle.py__file__() # type: ignore[no-any-return]
|
||||
|
||||
|
||||
class CompiledName(AbstractNameDefinition):
|
||||
|
||||
Reference in New Issue
Block a user