[neon/forks/ubuntu-release-upgrader/Neon/unstable_focal] DistUpgrade: since we don't need to support python2.4 use finally

Brian Murray null at kde.org
Wed Jul 28 09:25:04 BST 2021


Git commit b72787a35d9d3a5b43293bf3f23d41eb10b71b5a by Brian Murray.
Committed on 01/07/2021 at 00:08.
Pushed by jriddell into branch 'Neon/unstable_focal'.

since we don't need to support python2.4 use finally

M  +4    -10   DistUpgrade/DistUpgradeCache.py

https://invent.kde.org/neon/forks/ubuntu-release-upgrader/commit/b72787a35d9d3a5b43293bf3f23d41eb10b71b5a

diff --git a/DistUpgrade/DistUpgradeCache.py b/DistUpgrade/DistUpgradeCache.py
index d34e3232..6b8ad5d6 100644
--- a/DistUpgrade/DistUpgradeCache.py
+++ b/DistUpgrade/DistUpgradeCache.py
@@ -660,10 +660,6 @@ class MyCache(apt.Cache):
                 raise SystemError(_("Broken packages after upgrade: %s") % ", ".join(p.name for p in self if p.is_inst_broken or p.is_now_broken))
 
         except SystemError as e:
-            # this should go into a finally: line, see below for the
-            # rationale why it doesn't
-            lock.release()
-            t.join()
             # the most likely problem is the 3rd party pkgs so don't address
             # foreignPkgs and devRelease being True
             details =  _("An unresolvable problem occurred while "
@@ -703,12 +699,10 @@ class MyCache(apt.Cache):
             # the withResolverLog decorator
             self._startAptResolverLog()
             return False
-        # would be nice to be able to use finally: here, but we need
-        # to run on python2.4 too
-        #finally:
-        # wait for the gui-update thread to exit
-        lock.release()
-        t.join()
+        finally:
+            # wait for the gui-update thread to exit
+            lock.release()
+            t.join()
 
         # check the trust of the packages that are going to change
         untrusted = []



More information about the Neon-commits mailing list