forked from VimPlug/jedi
Fix a few casts for Python 2/3 interopability
This commit is contained in:
@@ -5,7 +5,7 @@ import re
|
|||||||
from functools import partial
|
from functools import partial
|
||||||
|
|
||||||
from jedi import debug
|
from jedi import debug
|
||||||
from jedi._compatibility import force_unicode, Parameter
|
from jedi._compatibility import force_unicode, Parameter, cast_path
|
||||||
from jedi.cache import underscore_memoization, memoize_method
|
from jedi.cache import underscore_memoization, memoize_method
|
||||||
from jedi.evaluate.filters import AbstractFilter
|
from jedi.evaluate.filters import AbstractFilter
|
||||||
from jedi.evaluate.names import AbstractNameDefinition, ContextNameMixin
|
from jedi.evaluate.names import AbstractNameDefinition, ContextNameMixin
|
||||||
@@ -80,7 +80,7 @@ class CompiledObject(Context):
|
|||||||
|
|
||||||
@CheckAttribute()
|
@CheckAttribute()
|
||||||
def py__path__(self):
|
def py__path__(self):
|
||||||
return self.access_handle.py__path__()
|
return map(cast_path, self.access_handle.py__path__())
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def string_names(self):
|
def string_names(self):
|
||||||
@@ -97,7 +97,7 @@ class CompiledObject(Context):
|
|||||||
return self.access_handle.py__bool__()
|
return self.access_handle.py__bool__()
|
||||||
|
|
||||||
def py__file__(self):
|
def py__file__(self):
|
||||||
return self.access_handle.py__file__()
|
return cast_path(self.access_handle.py__file__())
|
||||||
|
|
||||||
def is_class(self):
|
def is_class(self):
|
||||||
return self.access_handle.is_class()
|
return self.access_handle.is_class()
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import os
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
from parso.file_io import FileIO
|
from parso.file_io import FileIO
|
||||||
from jedi._compatibility import FileNotFoundError
|
from jedi._compatibility import FileNotFoundError, cast_path
|
||||||
from jedi.parser_utils import get_cached_code_lines
|
from jedi.parser_utils import get_cached_code_lines
|
||||||
from jedi.evaluate.cache import evaluator_function_cache
|
from jedi.evaluate.cache import evaluator_function_cache
|
||||||
from jedi.evaluate.base_context import ContextSet
|
from jedi.evaluate.base_context import ContextSet
|
||||||
@@ -31,6 +31,7 @@ def _create_stub_map(directory):
|
|||||||
return
|
return
|
||||||
|
|
||||||
for entry in listed:
|
for entry in listed:
|
||||||
|
entry = cast_path(entry)
|
||||||
path = os.path.join(directory, entry)
|
path = os.path.join(directory, entry)
|
||||||
if os.path.isdir(path):
|
if os.path.isdir(path):
|
||||||
init = os.path.join(path, '__init__.pyi')
|
init = os.path.join(path, '__init__.pyi')
|
||||||
|
|||||||
Reference in New Issue
Block a user