Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions mypy/dmypy.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,7 @@ def do_run(args: argparse.Namespace) -> None:
since we don't want to duplicate mypy's huge list of flags.
(The -- is only necessary if flags are specified.)
"""
try:
get_status()
except BadStatus as err:
if not is_running():
# Bad or missing status file or dead process; good to start.
start_server(args, allow_sources=True)

Expand Down Expand Up @@ -441,6 +439,15 @@ def read_status() -> Dict[str, object]:
return data


def is_running() -> bool:
"""Check if the server is running cleanly"""
try:
get_status()
except BadStatus as err:
return False
return True


# Run main().

if __name__ == '__main__':
Expand Down