Commit 4ff1830
authored
Filter SyntaxWarnings during AST parsing (#20023)
Especially with [PEP 765](https://peps.python.org/pep-0765/) in 3.14,
Python has been getting more liberal in emitting SyntaxWarnings during
AST parsing and compilation. Generally, they aren't really helpful for
mypy itself. There are open discussions to add a flag which would
disable these. Until that's implemented, filter the warnings manually.
_This also get's rid of the warnings emitted on test code. If at some
point `return in finally` will be made an error, those tests could be
adjust / removed. Until then, we can continue to test these as is
without issues._
```py
def func() -> None:
try:
x = 1/0
finally:
return None # return in finally
"Hello \P world" # invalid escape sequence
"" is 1 # "is" with 'int' literal
```1 parent f2ebd79 commit 4ff1830
2 files changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
236 | 238 | | |
237 | 239 | | |
| 240 | + | |
238 | 241 | | |
239 | 242 | | |
240 | 243 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | 230 | | |
234 | 231 | | |
235 | 232 | | |
| |||
0 commit comments