1
0
mirror of https://github.com/actions/setup-python synced 2024-12-02 21:42:28 +08:00

Compare commits

...

2 Commits

Author SHA1 Message Date
Eric Wieser
df5435eba6
Merge 82009b3bde into 70dcb22d26 2024-09-11 14:22:16 +02:00
Eric Wieser
82009b3bde
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.
2022-06-07 18:21:56 +01:00

9
.github/python.json vendored
View File

@ -4,13 +4,16 @@
"owner": "python", "owner": "python",
"pattern": [ "pattern": [
{ {
"regexp": "^\\s*File\\s\\\"(.*)\\\",\\sline\\s(\\d+),\\sin\\s(.*)$", "regexp": "^ File \"([^\"]*)\", line (\\d+).*",
"file": 1, "file": 1,
"line": 2 "line": 2
}, },
{ {
"regexp": "^\\s*raise\\s(.*)\\(\\'(.*)\\'\\)$", "regexp": "^ .*$"
"message": 2 },
{
"regexp": "^(?! File)(.*)\\s*$",
"message": 1
} }
] ]
} }