mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-10-18 03:51:30 +08:00
AttributeError exception in copy_method_to_another_class (#531)
* Fix for method_node having no arguments * Trim whitespace
This commit is contained in:
1 parent
19d695b1da
commit
4cb13a6ac5
1 file changed
+6
-1
@@ -361,8 +361,13 @@ def copy_method_to_another_class(
|
||||
if isinstance(bound_return_type, PlaceholderNode):
|
||||
return
|
||||
|
||||
try:
|
||||
original_arguments = method_node.arguments[1:]
|
||||
except AttributeError:
|
||||
original_arguments = []
|
||||
|
||||
for arg_name, arg_type, original_argument in zip(
|
||||
method_type.arg_names[1:], method_type.arg_types[1:], method_node.arguments[1:]
|
||||
method_type.arg_names[1:], method_type.arg_types[1:], original_arguments
|
||||
):
|
||||
bound_arg_type = semanal_api.anal_type(arg_type, allow_placeholder=True)
|
||||
if bound_arg_type is None and not semanal_api.final_iteration:
|
||||
|
||||
Reference in new issue
Block a user