python-trio / flake8-async

Highly opinionated linter for Trio code
https://flake8-async.readthedocs.io
MIT License
17 stars 2 forks source link

Internal error with `ASYNC91x` #226

Closed Zac-HD closed 5 months ago

Zac-HD commented 6 months ago
import trio

async def fn():
    try:
        while True:
            try:
                await trio.sleep(1)
            except Exception:
                pass
    except Exception:
        pass

triggers

  File ".../flake8_async/visitors/visitor91x.py", line 346, in check_function_exit
    assert not isinstance(original_node, cst.FunctionDef)
  AssertionError
jakkdl commented 6 months ago

it's not isolated to ASYNC900, it also happens with 910 or 911.

EDIT: no it's for 910 and 911. I thought it was weird an error in visitor91x was caused by 900