File: mypy.py

package info (click to toggle)
fs-uae-arcade 3.1.63-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 24,456 kB
  • sloc: python: 56,011; makefile: 170
file content (9 lines) | stat: -rw-r--r-- 313 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
import subprocess


def check_module(module_name):
    p = subprocess.Popen(["mypy", "-m", module_name], stderr=subprocess.PIPE)
    output = p.stderr.read()  # type: bytes
    if p.wait() != 0:
        print(output.decode("UTF-8"))
        raise Exception("mypy check failed for module {0}".format(module_name))