(expr: Expression, name: str)
| 321 | |
| 322 | |
| 323 | def is_sys_attr(expr: Expression, name: str) -> bool: |
| 324 | # TODO: This currently doesn't work with code like this: |
| 325 | # - import sys as _sys |
| 326 | # - from sys import version_info |
| 327 | if isinstance(expr, MemberExpr) and expr.name == name: |
| 328 | if isinstance(expr.expr, NameExpr) and expr.expr.name == "sys": |
| 329 | # TODO: Guard against a local named sys, etc. |
| 330 | # (Though later passes will still do most checking.) |
| 331 | return True |
| 332 | return False |
| 333 | |
| 334 | |
| 335 | def mark_block_unreachable(block: Block) -> None: |
no test coverage detected
searching dependent graphs…