Report issues with the Python used to run mypy, dmypy, or stubgen
(program: str)
| 490 | |
| 491 | |
| 492 | def check_python_version(program: str) -> None: |
| 493 | """Report issues with the Python used to run mypy, dmypy, or stubgen""" |
| 494 | # Check for known bad Python versions. |
| 495 | if sys.version_info[:2] < (3, 10): # noqa: UP036, RUF100 |
| 496 | sys.exit( |
| 497 | "Running {name} with Python 3.9 or lower is not supported; " |
| 498 | "please upgrade to 3.10 or newer".format(name=program) |
| 499 | ) |
| 500 | |
| 501 | |
| 502 | def count_stats(messages: list[str]) -> tuple[int, int, int]: |