This repository has been archived by the owner on Aug 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 68
Exit on SIGHUP signal #129
Merged
DonJayamanne
merged 5 commits into
microsoft:master
from
DonJayamanne:handleSIGHUPEvent
Feb 28, 2018
Merged
Exit on SIGHUP signal #129
DonJayamanne
merged 5 commits into
microsoft:master
from
DonJayamanne:handleSIGHUPEvent
Feb 28, 2018
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int19h
reviewed
Feb 27, 2018
ptvsd/wrapper.py
Outdated
@@ -943,6 +944,10 @@ def start_server(port): | |||
client, _ = server.accept() | |||
pydevd, proc, _ = _start(client, server) | |||
atexit.register(proc.close) | |||
def signal_handler(signum, frame): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this gets repeated, I'd rather have it as a separate function that is wired up through a lambda here (so that we don't have multiple places to update in the future).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean something like this:
def signal_handler(signum, frame, proc):
proc.close()
sys.exit(0)
...
def start_server(port):
...
signal.signal(signal.SIGHUP, lambda signum, frame: signal_handler(signum, frame, proc))
@int19h I've address you'd like your comments. Please check again |
int19h
approved these changes
Feb 28, 2018
Good to go as soon as merge conflicts are resolved. |
Done. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #128