If signal module SIGHUP - let's ignore it

What can go wrong, huh?
This commit is contained in:
Oleksii Shevchuk 2017-05-18 20:55:04 +03:00 committed by Oleksii Shevchuk
parent f38c33f285
commit 5596b291bd
1 changed files with 7 additions and 0 deletions

View File

@ -64,6 +64,7 @@ import logging
import shlex
import marshal
import zlib
import signal
try:
# additional imports needed to package with pyinstaller
@ -285,6 +286,9 @@ def set_connect_back_host(HOST):
def handle_sigchld(*args, **kwargs):
os.waitpid(-1, os.WNOHANG)
def handle_sighup(*args):
pass
attempt = 0
def main():
@ -293,6 +297,9 @@ def main():
global debug
global attempt
if hasattr(signal, 'SIGHUP'):
signal.signal(signal.SIGHUP, handle_sighup)
if len(sys.argv) > 1:
parser = argparse.ArgumentParser(
prog='pp.py',