Skip to content

Commit 4a744b3

Browse files
authored
Print compilation status with --version (#12318)
Resolves #12317 Co-authored-by: hauntsaninja <>
1 parent 47e2ca8 commit 4a744b3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mypy/main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,9 +492,11 @@ def add_invertible_flag(flag: str,
492492
general_group.add_argument(
493493
'-v', '--verbose', action='count', dest='verbosity',
494494
help="More verbose messages")
495+
496+
compilation_status = "no" if __file__.endswith(".py") else "yes"
495497
general_group.add_argument(
496498
'-V', '--version', action=CapturableVersionAction,
497-
version='%(prog)s ' + __version__,
499+
version='%(prog)s ' + __version__ + f" (compiled: {compilation_status})",
498500
help="Show program's version number and exit",
499501
stdout=stdout)
500502

0 commit comments

Comments
 (0)