@@ -547,7 +547,7 @@ def fix_function_overloads(self, stmts: List[Statement]) -> List[Statement]:
547
547
# Add bare IfStmt (without overloads) to ret
548
548
# Required for mypy to be able to still check conditions
549
549
for if_stmt in skipped_if_stmts :
550
- ASTConverter ._strip_contents_from_if_stmt (if_stmt )
550
+ self ._strip_contents_from_if_stmt (if_stmt )
551
551
ret .append (if_stmt )
552
552
skipped_if_stmts = []
553
553
if len (current_overload ) == 1 :
@@ -585,7 +585,7 @@ def fix_function_overloads(self, stmts: List[Statement]) -> List[Statement]:
585
585
# Add bare IfStmt (without overloads) to ret
586
586
# Required for mypy to be able to still check conditions
587
587
for if_stmt in skipped_if_stmts :
588
- ASTConverter ._strip_contents_from_if_stmt (if_stmt )
588
+ self ._strip_contents_from_if_stmt (if_stmt )
589
589
ret .append (if_stmt )
590
590
if len (current_overload ) == 1 :
591
591
ret .append (current_overload [0 ])
@@ -650,18 +650,17 @@ def _get_executable_if_block_with_overloads(self, stmt: IfStmt) -> Optional[Bloc
650
650
return stmt .else_body
651
651
return None
652
652
653
- @staticmethod
654
- def _strip_contents_from_if_stmt (stmt : IfStmt ) -> None :
653
+ def _strip_contents_from_if_stmt (self , stmt : IfStmt ) -> None :
655
654
"""Remove contents from IfStmt.
656
655
657
656
Needed to still be able to check the conditions after the contents
658
- have been merged with the surrunding function overloads.
657
+ have been merged with the surrounding function overloads.
659
658
"""
660
659
if len (stmt .body ) == 1 :
661
660
stmt .body [0 ].body = []
662
661
if stmt .else_body and len (stmt .else_body .body ) == 1 :
663
662
if isinstance (stmt .else_body .body [0 ], IfStmt ):
664
- ASTConverter ._strip_contents_from_if_stmt (stmt .else_body .body [0 ])
663
+ self ._strip_contents_from_if_stmt (stmt .else_body .body [0 ])
665
664
else :
666
665
stmt .else_body .body = []
667
666
0 commit comments