summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Fayolle <alexandre.fayolle@logilab.fr>2009-02-03 12:33:50 +0100
committerAlexandre Fayolle <alexandre.fayolle@logilab.fr>2009-02-03 12:33:50 +0100
commit557900f60c935911458f9db5787cb263edf21c02 (patch)
treecf92f9287fc6061b7464b9697e24ad5307a66682
parente7b0eb487b77f36c776b477f7ce1497792b5b8fa (diff)
downloadlogilab-common-557900f60c935911458f9db5787cb263edf21c02.tar.gz
fix #7915
-rw-r--r--proc.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/proc.py b/proc.py
index a08969e..24bf679 100644
--- a/proc.py
+++ b/proc.py
@@ -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