mypy
5349f9a6 - Avoid slow error message logic if errors not shown to user (#14336)

Commit
3 years ago
Avoid slow error message logic if errors not shown to user (#14336) This helps with await-related errors introduced in #12958, in particular, which are expensive to generate. If errors are ignored (e.g. in third-party libraries) or we don't care about the error message, use simpler error message logic. We also often filter out error messages temporarily, so any effort in constructing a nice error message is wasted. We could skip even more logic, but this should cover many of the important code paths. This speeds up self check by about 2%.
Author
Parents
Loading