summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-09-03 18:26:57 -0700
committerZac Medico <zmedico@gentoo.org>2010-09-03 18:26:57 -0700
commitdf4a62e1f2ca381b7538246378662a69afc4e19e (patch)
treef6f6f367c9af2de162fb53ed014da494c67e5999
parent36e310228280be6d662677f3cfe5bba1e71d4dfd (diff)
downloadportage-df4a62e1f2ca381b7538246378662a69afc4e19e.tar.gz
portage-df4a62e1f2ca381b7538246378662a69afc4e19e.tar.bz2
portage-df4a62e1f2ca381b7538246378662a69afc4e19e.zip
Adjust AlarmSignal.unregister() call in ebuild-ipc.
-rwxr-xr-xbin/ebuild-ipc.py15
1 files changed, 8 insertions, 7 deletions
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)