summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-09-03 17:23:08 -0700
committerZac Medico <zmedico@gentoo.org>2010-09-03 17:23:08 -0700
commit7f9f0653aa142ad33c7f95b959d254e52d0a0569 (patch)
treee0e2e5ca97535afdf18f0cb1a7e678738ef9b618
parent77fb8383288425e1b79d8092828da0b87e6293aa (diff)
downloadportage-7f9f0653aa142ad33c7f95b959d254e52d0a0569.tar.gz
portage-7f9f0653aa142ad33c7f95b959d254e52d0a0569.tar.bz2
portage-7f9f0653aa142ad33c7f95b959d254e52d0a0569.zip
Make AlarmSignal.register() require a time parameter and pass it to
signal.alarm().
-rwxr-xr-xbin/ebuild-ipc.py4
-rw-r--r--pym/portage/exception.py3
2 files changed, 4 insertions, 3 deletions
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):