Use a try/finally block to ensure that the alarm will always be cancelled appropriately.
authorZac Medico <zmedico@gentoo.org>
Sat, 30 Dec 2006 21:14:55 +0000 (21:14 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 30 Dec 2006 21:14:55 +0000 (21:14 -0000)
svn path=/main/trunk/; revision=5431

pym/portage.py

index 2942bb2573b1bef34f765c7c2f750172182db22a..f127b788c67dad99e50625436b2babd1ee8b1e5d 100644 (file)
@@ -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)