Remove contents from IfStmt. Needed to still be able to check the conditions after the contents have been merged with the surrounding function overloads.
(stmt: IfStmt)
| 1682 | |
| 1683 | |
| 1684 | def strip_contents_from_if_stmt(stmt: IfStmt) -> None: |
| 1685 | """Remove contents from IfStmt. |
| 1686 | |
| 1687 | Needed to still be able to check the conditions after the contents |
| 1688 | have been merged with the surrounding function overloads. |
| 1689 | """ |
| 1690 | if len(stmt.body) == 1: |
| 1691 | stmt.body[0].body = [] |
| 1692 | if stmt.else_body and len(stmt.else_body.body) == 1: |
| 1693 | if isinstance(stmt.else_body.body[0], IfStmt): |
| 1694 | strip_contents_from_if_stmt(stmt.else_body.body[0]) |
| 1695 | else: |
| 1696 | stmt.else_body.body = [] |
| 1697 | |
| 1698 | |
| 1699 | def is_stripped_if_stmt(stmt: Statement) -> bool: |
no test coverage detected
searching dependent graphs…