Wrap code in a function so the taint engine's CFG builder processes it.
(code: str)
| 16 | |
| 17 | |
| 18 | def _wrap_in_function(code: str) -> str: |
| 19 | """Wrap code in a function so the taint engine's CFG builder processes it.""" |
| 20 | indented = "\n".join(" " + line for line in textwrap.dedent(code).splitlines()) |
| 21 | return f"def _test_view(request):\n{indented}\n" |
| 22 | |
| 23 | |
| 24 | def run_pyspector(code: str, *, filename: str = "app.py") -> list[dict]: |