Fix breakage from previous commit.
authorZac Medico <zmedico@gentoo.org>
Sat, 4 Sep 2010 01:02:29 +0000 (18:02 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 4 Sep 2010 01:02:29 +0000 (18:02 -0700)
pym/_emerge/actions.py

index 294d9a9d0403226f7897338d13326b0ad285640a..03ca784d62f11f896c2bcc7388346c673d482167 100644 (file)
@@ -2130,10 +2130,11 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
                                        # Timeout here in case the server is unresponsive.  The
                                        # --timeout rsync option doesn't apply to the initial
                                        # connection attempt.
-                                       if rsync_initial_timeout:
-                                               portage.exception.AlarmSignal.register(
-                                                       rsync_initial_timeout)
                                        try:
+                                               if rsync_initial_timeout:
+                                                       portage.exception.AlarmSignal.register(
+                                                               rsync_initial_timeout)
+
                                                mypids.extend(portage.process.spawn(
                                                        mycommand, returnpid=True, **spawn_kwargs))
                                                exitcode = os.waitpid(mypids[0], 0)[1]
@@ -2142,6 +2143,8 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
                                                                uid=os.getuid())
                                                content = portage.grabfile(tmpservertimestampfile)
                                        finally:
+                                               if rsync_initial_timeout:
+                                                       portage.exception.AlarmSignal.unregister()
                                                try:
                                                        os.unlink(tmpservertimestampfile)
                                                except OSError:
@@ -2154,9 +2157,6 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
                                                os.waitpid(mypids[0], 0)
                                        # This is the same code rsync uses for timeout.
                                        exitcode = 30
-                               finally:
-                                       if rsync_initial_timeout:
-                                               portage.exception.AlarmSignal.unregister()
                                else:
                                        if exitcode != os.EX_OK:
                                                if exitcode & 0xff: