mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
More detailed testing for value-error-too-few-values.
This commit is contained in:
@@ -401,7 +401,7 @@ def unpack_tuple_to_dict(evaluator, types, exprlist):
|
||||
else:
|
||||
dct.update(unpack_tuple_to_dict(evaluator, iter_types, part))
|
||||
has_parts = next(parts, None)
|
||||
if n > 0 and has_parts is not None:
|
||||
if types and has_parts is not None:
|
||||
analysis.add(evaluator, 'value-error-too-few-values', has_parts,
|
||||
message="ValueError: need more than %s values to unpack" % n)
|
||||
return dct
|
||||
|
||||
@@ -15,4 +15,7 @@ for x, y in dct:
|
||||
|
||||
# Shouldn't cause issues, because if there are no types (or we don't know what
|
||||
# the types are, we should just ignore it.
|
||||
#! 0 value-error-too-few-values
|
||||
a, b = []
|
||||
#! 7 name-error
|
||||
a, b = NOT_DEFINED
|
||||
|
||||
Reference in New Issue
Block a user