Skip to content

Commit 1d6e671

Browse files
Guido van Rossumilevkivskyi
Guido van Rossum
authored andcommitted
Make fail() in main.py use exit code 2 (#6738)
This is in line with the recommendation from #6003. (It is called if there's something wrong with a filename.)
1 parent e954da0 commit 1d6e671

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

mypy/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1056,4 +1056,4 @@ def parse_section(prefix: str, template: Options,
10561056

10571057
def fail(msg: str) -> None:
10581058
sys.stderr.write('%s\n' % msg)
1059-
sys.exit(1)
1059+
sys.exit(2)

test-data/unit/cmdline.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ dir/a.py:1: error: Name 'undef' is not defined
8888
undef
8989
[out]
9090
sub.pkg is not a valid Python package name
91+
== Return code: 2
9192

9293
[case testBadFileEncoding]
9394
# cmd: mypy a.py

0 commit comments

Comments
 (0)