###############################################################################
from multiprocessing.pool import Pool
-from signal import signal, SIGHUP, SIGTERM, SIGPIPE, SIGCHLD, SIGALRM
+from signal import signal, SIGHUP, SIGTERM, SIGPIPE, SIGALRM
import sqlalchemy.orm.session
signal(SIGHUP, signal_handler)
signal(SIGTERM, signal_handler)
signal(SIGPIPE, signal_handler)
- signal(SIGCHLD, signal_handler)
signal(SIGALRM, signal_handler)
# We expect our callback function to return:
# messages is a string used for logging
try:
return (func(*args, **kwds))
- except SignalException, e:
+ except SignalException as e:
return (PROC_STATUS_SIGNALRAISED, e.signum)
- except Exception, e:
+ except Exception as e:
return (PROC_STATUS_EXCEPTION, str(e))
finally:
# Make sure connections are closed. We might die otherwise.