New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dmypy run when no target given #6153

Merged
merged 8 commits into from Jan 8, 2019

Conversation

Projects
None yet
2 participants
@ethanhs
Copy link
Collaborator

ethanhs commented Jan 7, 2019

dmypy run without a target given will cause the daemon to die unexpectedly on calling mypy.main.process_options with improper arguments.

This catches the SystemExit the argument parser throws and captures sys.stderr for the output of the parser. I had to backport redirect_stderr since that is not available in 3.4, but the backport can be removed in a couple of months when we drop support for 3.4.

I'm not entirely sure if passing the way I'm passing the error messages is a good idea or not, but it certainly is better than dying with just [WinError 233] No process is on the other end of the pipe.

ethanhs added some commits Jan 6, 2019

@ethanhs ethanhs requested a review from msullivan Jan 7, 2019

ethanhs added some commits Jan 7, 2019

@ethanhs ethanhs referenced this pull request Jan 7, 2019

Closed

Release 0.660 planning #6130

@gvanrossum
Copy link
Member

gvanrossum left a comment

Just some nits, otherwise LGTM. Just let's delete the cloned code ASAP.

Show resolved Hide resolved mypy/dmypy.py Outdated
Show resolved Hide resolved mypy/util.py
Show resolved Hide resolved mypy/dmypy_server.py Outdated
Show resolved Hide resolved mypy/dmypy_server.py Outdated
@ethanhs

This comment has been minimized.

Copy link
Collaborator Author

ethanhs commented Jan 8, 2019

Just let's delete the cloned code ASAP.

This won't be a problem, I look forward to taking advantage of some 3.5 features in several places :)

@ethanhs ethanhs merged commit 41d6aea into python:master Jan 8, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@ethanhs ethanhs deleted the ethanhs:daemonsysexit branch Jan 8, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment