mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-10 07:41:51 +08:00
fix a few more minor issues
This commit is contained in:
@@ -436,7 +436,7 @@ def get_modules_containing_name(mods, name):
|
||||
return load_module(path, source)
|
||||
|
||||
# skip non python modules
|
||||
mods = set(m for m in mods if m.path is None or m.path.endswith('.py'))
|
||||
mods = set(m for m in mods if not isinstance(m, compiled.PyObject))
|
||||
mod_paths = set()
|
||||
for m in mods:
|
||||
mod_paths.add(m.path)
|
||||
|
||||
@@ -228,7 +228,7 @@ def _check_array_additions(evaluator, compare_array, module, is_list):
|
||||
>>> a = [""]
|
||||
>>> a.append(1)
|
||||
"""
|
||||
if not settings.dynamic_array_additions or module.is_builtin():
|
||||
if not settings.dynamic_array_additions or isinstance(module, compiled.PyObject):
|
||||
return []
|
||||
|
||||
def check_calls(calls, add_name):
|
||||
|
||||
@@ -155,7 +155,7 @@ def _var_args_iterator(evaluator, var_args):
|
||||
yield None, field_stmt
|
||||
elif isinstance(array, iterable.Generator):
|
||||
for field_stmt in array.iter_content():
|
||||
yield None, helpers._FakeStatement([field_stmt])
|
||||
yield None, helpers.FakeStatement([field_stmt])
|
||||
# **kwargs
|
||||
elif expression_list[0] == '**':
|
||||
for array in evaluator.eval_expression_list(expression_list[1:]):
|
||||
|
||||
@@ -362,17 +362,13 @@ class SubModule(Scope, Module):
|
||||
string = '' # no path -> empty name
|
||||
else:
|
||||
sep = (re.escape(os.path.sep),) * 2
|
||||
r = re.search(r'([^%s]*?)(%s__init__)?(\.py|\.so)?$' % sep,
|
||||
self.path)
|
||||
r = re.search(r'([^%s]*?)(%s__init__)?(\.py|\.so)?$' % sep, self.path)
|
||||
# remove PEP 3149 names
|
||||
string = re.sub('\.[a-z]+-\d{2}[mud]{0,3}$', '', r.group(1))
|
||||
# positions are not real therefore choose (0, 0)
|
||||
names = [(string, (0, 0))]
|
||||
return Name(self, names, (0, 0), (0, 0), self.use_as_parent)
|
||||
|
||||
def is_builtin(self):
|
||||
return not (self.path is None or self.path.endswith('.py'))
|
||||
|
||||
@property
|
||||
def has_explicit_absolute_import(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user