From 77fb8383288425e1b79d8092828da0b87e6293aa Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 3 Sep 2010 17:11:03 -0700 Subject: Add AlarmSignal.register() and unregister() classmethods in order to handle interaction with the signal module. --- bin/ebuild-ipc.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'bin/ebuild-ipc.py') diff --git a/bin/ebuild-ipc.py b/bin/ebuild-ipc.py index b4a1f7767..b3d28a789 100755 --- a/bin/ebuild-ipc.py +++ b/bin/ebuild-ipc.py @@ -49,10 +49,9 @@ class EbuildIpc(object): start_time = time.time() try: - signal.signal(signal.SIGALRM, portage.exception.AlarmSignal.signal_handler) + portage.exception.AlarmSignal.register() signal.alarm(self._COMMUNICATE_TIMEOUT_SECONDS) returncode = self._communicate(args) - signal.alarm(0) return returncode except portage.exception.AlarmSignal: time_elapsed = time.time() - start_time @@ -62,7 +61,7 @@ class EbuildIpc(object): level=logging.ERROR, noiselevel=-1) return 1 finally: - signal.alarm(0) + portage.exception.AlarmSignal.unregister() portage.locks.unlockfile(lock_obj) def _communicate(self, args): -- cgit v1.2.3-1-g7c22