Exit peacefully on KeyboardInterrupt#214
Conversation
| return arg_parser | ||
|
|
||
|
|
||
| def signal_handler(signal, frame): |
There was a problem hiding this comment.
What is the need of passing arguments to this function if you are not using them?
There was a problem hiding this comment.
I get the following error if i don't pass the arguments,
TypeError: signal_handler() takes 0 positional arguments but 2 were given
There was a problem hiding this comment.
@jackthepirate6 thats probably because you are forgetting self or cls. You need to remove those unnecessary arguments.
|
And in commit description: |
| import logging | ||
| import os | ||
| import sys | ||
| import signal |
There was a problem hiding this comment.
this import will be above import sys following alphabetical order ;)
| def signal_handler(self, cls): | ||
| sys.exit(0) | ||
|
|
||
|
|
There was a problem hiding this comment.
According to E302 of pep8, there should be two blank lines instead of one
There was a problem hiding this comment.
although I didn't mean for you to add both self and cls
There was a problem hiding this comment.
both are actually the same, with different names
There was a problem hiding this comment.
It is difficult to know when a person will system exit.
There was a problem hiding this comment.
So it's kind of better to initialise exception handler first
There was a problem hiding this comment.
hmmm... frankly speaking I don't understand what you are trying to do over here 🤪 but adding those two parameters without knowing why its working that way is definitely wrong
There was a problem hiding this comment.
i am trying to capture the exception globally.
There was a problem hiding this comment.
i will remove the unnecessary parameters.
Captured keyboardinterrupt without traceback. Closes coala#179
jayvdb
left a comment
There was a problem hiding this comment.
Please review your commit message to follow http://coala.io/commit , and capitalise exception names correctly.
Captured keyboardinterrupt without traceback.
Closes issue #179