From: Zac Medico Date: Sat, 4 Sep 2010 00:23:08 +0000 (-0700) Subject: Make AlarmSignal.register() require a time parameter and pass it to X-Git-Tag: v2.2_rc75~16 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7f9f0653aa142ad33c7f95b959d254e52d0a0569;p=portage.git Make AlarmSignal.register() require a time parameter and pass it to signal.alarm(). --- diff --git a/bin/ebuild-ipc.py b/bin/ebuild-ipc.py index b3d28a789..baa7abb4c 100755 --- a/bin/ebuild-ipc.py +++ b/bin/ebuild-ipc.py @@ -49,8 +49,8 @@ class EbuildIpc(object): start_time = time.time() try: - portage.exception.AlarmSignal.register() - signal.alarm(self._COMMUNICATE_TIMEOUT_SECONDS) + portage.exception.AlarmSignal.register( + self._COMMUNICATE_TIMEOUT_SECONDS) returncode = self._communicate(args) return returncode except portage.exception.AlarmSignal: diff --git a/pym/portage/exception.py b/pym/portage/exception.py index dca1100e6..ae655542a 100644 --- a/pym/portage/exception.py +++ b/pym/portage/exception.py @@ -91,8 +91,9 @@ class AlarmSignal(TimeoutException): self.frame = frame @classmethod - def register(cls): + def register(cls, time): signal.signal(signal.SIGALRM, cls._signal_handler) + signal.alarm(time) @classmethod def unregister(cls):