Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a better python problem matcher #420

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Jun 7, 2022

  1. Use a better python problem matcher

    The old matcher only worked if the error was raised with `raise Exception('single quotes')`.
    
    This represents a miniscule fraction of errors; for instance, `l[37]` on a short list `l` can raise `IndexError`, and any call to a builtin C function is not going to trace back to a `raise` call.
    
    Instead, this just matches the first line without fail that comes after the context line.
    
    Note that this is still not foolproof; in Python 3.10, `SyntaxError`s are produced as 
    ```
      File "<stdin>", line 1
        foo(x, z for z in range(10), t, w)
               ^^^^^^^^^^^^^^^^^^^^
    SyntaxError: Generator expression must be parenthesized
    ```
    
    This matcher will incorrectly pick up `           ^^^^^^^^^^^^^^^^^^^^` as the error message, but the previous behavior was to not pick up any error message at all.
    
    As far as I can tell, this is impossible to handle correctly; the grammar of problem matchers is far too limiting.
    eric-wieser committed Jun 7, 2022
    Configuration menu
    Copy the full SHA
    82009b3 View commit details
    Browse the repository at this point in the history