From: Zac Medico Date: Sat, 4 Sep 2010 01:26:57 +0000 (-0700) Subject: Adjust AlarmSignal.unregister() call in ebuild-ipc. X-Git-Tag: v2.2_rc75~9 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=df4a62e1f2ca381b7538246378662a69afc4e19e;p=portage.git Adjust AlarmSignal.unregister() call in ebuild-ipc. --- diff --git a/bin/ebuild-ipc.py b/bin/ebuild-ipc.py index baa7abb4c..27fbf9714 100755 --- a/bin/ebuild-ipc.py +++ b/bin/ebuild-ipc.py @@ -49,10 +49,14 @@ class EbuildIpc(object): start_time = time.time() try: - portage.exception.AlarmSignal.register( - self._COMMUNICATE_TIMEOUT_SECONDS) - returncode = self._communicate(args) - return returncode + try: + portage.exception.AlarmSignal.register( + self._COMMUNICATE_TIMEOUT_SECONDS) + returncode = self._communicate(args) + return returncode + finally: + portage.exception.AlarmSignal.unregister() + portage.locks.unlockfile(lock_obj) except portage.exception.AlarmSignal: time_elapsed = time.time() - start_time portage.util.writemsg_level( @@ -60,9 +64,6 @@ class EbuildIpc(object): (time_elapsed,), level=logging.ERROR, noiselevel=-1) return 1 - finally: - portage.exception.AlarmSignal.unregister() - portage.locks.unlockfile(lock_obj) def _communicate(self, args): input_fd = os.open(self.ipc_out_fifo, os.O_RDONLY|os.O_NONBLOCK)