summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-12-30 21:14:55 +0000
committerZac Medico <zmedico@gentoo.org>2006-12-30 21:14:55 +0000
commitcac3e113678f215fcf66592ea45a743580cb7984 (patch)
tree05823c1c42515d56f5a6ea8f57b7ed0b9469dc1a
parent74908c803545f9da870aaa4d904fc83808d3189a (diff)
downloadportage-cac3e113678f215fcf66592ea45a743580cb7984.tar.gz
portage-cac3e113678f215fcf66592ea45a743580cb7984.tar.bz2
portage-cac3e113678f215fcf66592ea45a743580cb7984.zip
Use a try/finally block to ensure that the alarm will always be cancelled appropriately.
svn path=/main/trunk/; revision=5431
-rw-r--r--pym/portage.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 2942bb257..f127b788c 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -513,8 +513,10 @@ def elog_process(cpv, mysettings):
# Timeout after one minute (in case something like the mail
# module gets hung).
signal.alarm(60)
- m.process(mysettings, cpv, mylogentries, fulllog)
- signal.alarm(0)
+ try:
+ m.process(mysettings, cpv, mylogentries, fulllog)
+ finally:
+ signal.alarm(0)
if hasattr(m, "finalize") and not m.finalize in _elog_atexit_handlers:
_elog_atexit_handlers.append(m.finalize)
atexit_register(m.finalize, mysettings)