mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-10 15:51:51 +08:00
Fix remaining issues with CompiledName.name change.
This commit is contained in:
@@ -293,12 +293,12 @@ def _iterate_star_args(evaluator, array, expression_list, func):
|
||||
elif isinstance(array, iterable.Generator):
|
||||
for field_stmt in array.iter_content():
|
||||
yield helpers.FakeStatement([field_stmt])
|
||||
elif isinstance(array, Instance) and array.name == 'tuple':
|
||||
elif isinstance(array, Instance) and array.name.get_code() == 'tuple':
|
||||
pass
|
||||
else:
|
||||
if expression_list:
|
||||
m = "TypeError: %s() argument after * must be a sequence, not %s" \
|
||||
% (func.name, array)
|
||||
% (func.name.get_code(), array)
|
||||
analysis.add(evaluator, 'type-error-star',
|
||||
expression_list[0], message=m)
|
||||
|
||||
@@ -306,7 +306,7 @@ def _iterate_star_args(evaluator, array, expression_list, func):
|
||||
def _star_star_dict(evaluator, array, expression_list, func):
|
||||
dct = {}
|
||||
from jedi.evaluate.representation import Instance
|
||||
if isinstance(array, Instance) and array.name == 'dict':
|
||||
if isinstance(array, Instance) and array.name.get_code() == 'dict':
|
||||
# For now ignore this case. In the future add proper iterators and just
|
||||
# make one call without crazy isinstance checks.
|
||||
return {}
|
||||
@@ -328,7 +328,7 @@ def _star_star_dict(evaluator, array, expression_list, func):
|
||||
else:
|
||||
if expression_list:
|
||||
m = "TypeError: %s argument after ** must be a mapping, not %s" \
|
||||
% (func.name, array)
|
||||
% (func.name.get_code(), array)
|
||||
analysis.add(evaluator, 'type-error-star-star',
|
||||
expression_list[0], message=m)
|
||||
return dct
|
||||
|
||||
@@ -347,7 +347,7 @@ def _element_calculate(evaluator, left, operator, right):
|
||||
|
||||
def check(obj):
|
||||
"""Checks if a Jedi object is either a float or an int."""
|
||||
return isinstance(obj, er.Instance) and obj.name in ('int', 'float')
|
||||
return isinstance(obj, er.Instance) and obj.name.get_code() in ('int', 'float')
|
||||
|
||||
# Static analysis, one is a number, the other one is not.
|
||||
if operator in ('+', '-') and l_is_num != r_is_num \
|
||||
|
||||
Reference in New Issue
Block a user