From 557900f60c935911458f9db5787cb263edf21c02 Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Tue, 3 Feb 2009 12:33:50 +0100 Subject: fix #7915 --- proc.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 -- cgit v1.2.1