mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-10 22:11:54 +08:00
AttributeError exception in build_unannotated_method_args (#429)
* AttributeError exception in build_unannotated_method_args * assigning [] to arguments if AttributeError Co-authored-by: Kacper Szmigiel <szmigielkacper@gmai.com>
This commit is contained in:
@@ -311,7 +311,11 @@ def add_new_sym_for_info(info: TypeInfo, *, name: str, sym_type: MypyType) -> No
|
|||||||
|
|
||||||
def build_unannotated_method_args(method_node: FuncDef) -> Tuple[List[Argument], MypyType]:
|
def build_unannotated_method_args(method_node: FuncDef) -> Tuple[List[Argument], MypyType]:
|
||||||
prepared_arguments = []
|
prepared_arguments = []
|
||||||
for argument in method_node.arguments[1:]:
|
try:
|
||||||
|
arguments = method_node.arguments[1:]
|
||||||
|
except AttributeError:
|
||||||
|
arguments = []
|
||||||
|
for argument in arguments:
|
||||||
argument.type_annotation = AnyType(TypeOfAny.unannotated)
|
argument.type_annotation = AnyType(TypeOfAny.unannotated)
|
||||||
prepared_arguments.append(argument)
|
prepared_arguments.append(argument)
|
||||||
return_type = AnyType(TypeOfAny.unannotated)
|
return_type = AnyType(TypeOfAny.unannotated)
|
||||||
|
|||||||
Reference in New Issue
Block a user