From 6164200cd6958830e3c04663e85651fd735bfda4 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 29 Apr 2019 08:19:24 -0700 Subject: [PATCH 1/2] Make fail() in main.py use exit code 2 This is in line with the recommendation from #6003. (It is called if there's something wrong with a filename.) --- mypy/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/main.py b/mypy/main.py index 0e4f8a67443a..97abbc483616 100644 --- a/mypy/main.py +++ b/mypy/main.py @@ -1056,4 +1056,4 @@ def parse_section(prefix: str, template: Options, def fail(msg: str) -> None: sys.stderr.write('%s\n' % msg) - sys.exit(1) + sys.exit(2) From fc84a88064fc6aa4a488b2a5e2e3fa92d389f908 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 29 Apr 2019 08:36:04 -0700 Subject: [PATCH 2/2] Fix test --- test-data/unit/cmdline.test | 1 + 1 file changed, 1 insertion(+) diff --git a/test-data/unit/cmdline.test b/test-data/unit/cmdline.test index 62a9b6a62488..464f2c8f15f5 100644 --- a/test-data/unit/cmdline.test +++ b/test-data/unit/cmdline.test @@ -88,6 +88,7 @@ dir/a.py:1: error: Name 'undef' is not defined undef [out] sub.pkg is not a valid Python package name +== Return code: 2 [case testBadFileEncoding] # cmd: mypy a.py