diff options
author | Alexandre Fayolle <alexandre.fayolle@logilab.fr> | 2009-02-03 12:33:50 +0100 |
---|---|---|
committer | Alexandre Fayolle <alexandre.fayolle@logilab.fr> | 2009-02-03 12:33:50 +0100 |
commit | 557900f60c935911458f9db5787cb263edf21c02 (patch) | |
tree | cf92f9287fc6061b7464b9697e24ad5307a66682 /proc.py | |
parent | e7b0eb487b77f36c776b477f7ce1497792b5b8fa (diff) | |
download | logilab-common-557900f60c935911458f9db5787cb263edf21c02.tar.gz |
fix #7915
Diffstat (limited to 'proc.py')
-rw-r--r-- | proc.py | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -112,7 +112,12 @@ class ProcInfoLoader: import tempfile import traceback -from signal import signal, SIGXCPU, SIGKILL, SIGUSR2, SIGUSR1 +from signal import signal +try: + from signal import SIGXCPU, SIGKILL, SIGUSR2, SIGUSR1 +except ImportError: # Windows ? + from signal import SIGKILL, SIGUSR2, SIGUSR1 + SIGXCPU = -1 from os import killpg, getpid, setpgrp from threading import Timer, currentThread, Thread, Event from time import time @@ -174,6 +179,8 @@ class ResourceController: def __init__(self, max_cpu_time=None, max_time=None, max_memory=None, max_reprieve=60): + if SIGXCPU == -1: + raise RuntimeError("Unsupported platform") self.max_time = max_time self.max_memory = max_memory self.max_cpu_time = max_cpu_time |