Parse Python content into AST, returning None on syntax error.
(content: str)
| 29 | |
| 30 | |
| 31 | def safe_parse_ast(content: str) -> ast.Module | None: |
| 32 | """Parse Python content into AST, returning None on syntax error.""" |
| 33 | try: |
| 34 | return ast.parse(content) |
| 35 | except SyntaxError: |
| 36 | return None |
| 37 | |
| 38 | |
| 39 | def iter_python_files(path: pathlib.Path) -> Iterator[pathlib.Path]: |
no test coverage detected