diff options
author | 2023-08-03 16:33:41 +0600 | |
---|---|---|
committer | 2023-08-03 16:33:41 +0600 | |
commit | 70faa8e9a0ff3cba74b4f753e257d56b768fcbd2 (patch) | |
tree | 3a49460715f7319d100e0cc9c1a278758500c7c8 /debian/patches/do-not-raise-stopiteration.patch | |
download | aptdaemon-70faa8e9a0ff3cba74b4f753e257d56b768fcbd2.tar.gz aptdaemon-70faa8e9a0ff3cba74b4f753e257d56b768fcbd2.zip |
Import Upstream version 1.1.1+bzr982
Diffstat (limited to 'debian/patches/do-not-raise-stopiteration.patch')
-rw-r--r-- | debian/patches/do-not-raise-stopiteration.patch | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/debian/patches/do-not-raise-stopiteration.patch b/debian/patches/do-not-raise-stopiteration.patch new file mode 100644 index 0000000..7813b36 --- /dev/null +++ b/debian/patches/do-not-raise-stopiteration.patch @@ -0,0 +1,68 @@ +Description: Adjust stopping generators for PEP479 + Adjust aptdaemon for PEP479, where raise StopIteration + stopped working and should become return. +Author: Julian Andres Klode <juliank@ubuntu.com> +Last-Update: 2019-03-27 + +--- aptdaemon-1.1.1+bzr982.orig/aptdaemon/core.py ++++ aptdaemon-1.1.1+bzr982/aptdaemon/core.py +@@ -935,7 +935,7 @@ class Transaction(DBusObject): + self.progress = 9 + yield self._simulate_real() + else: +- raise StopIteration ++ return + + @inline_callbacks + def _check_auth(self): +@@ -946,7 +946,7 @@ class Transaction(DBusObject): + self.status = enums.STATUS_AUTHENTICATING + action = self.ROLE_ACTION_MAP[self.role] + if action is None: +- raise StopIteration ++ return + # Special case if InstallPackages only touches stuff from the + # high trust whitelist + if (self.role in (enums.ROLE_INSTALL_PACKAGES, +@@ -1028,16 +1028,16 @@ class Transaction(DBusObject): + else: + self.status = enums.STATUS_CANCELLING + self.exit = enums.EXIT_CANCELLED +- raise StopIteration ++ return + if self.tid in self.queue.limbo: + self.exit = enums.EXIT_CANCELLED +- raise StopIteration ++ return + elif self.cancellable: + log_trans.debug("Setting cancel event") + self.cancelled = True + self.status = enums.STATUS_CANCELLING + self.paused = False +- raise StopIteration ++ return + raise errors.AptDaemonError("Could not cancel transaction") + + # pylint: disable-msg=C0103,C0322 +--- aptdaemon-1.1.1+bzr982.orig/aptdaemon/networking.py ++++ aptdaemon-1.1.1+bzr982/aptdaemon/networking.py +@@ -177,7 +177,7 @@ class NetworkManagerMonitor(NetworkMonit + def _on_nm_active_conn_props_changed(self, props): + """Callback if properties of the active connection changed.""" + if "Default" not in props: +- raise StopIteration ++ return + yield self.get_network_state() + + @inline_callbacks +--- aptdaemon-1.1.1+bzr982.orig/doc/source/aptdaemon.client.rst ++++ aptdaemon-1.1.1+bzr982/doc/source/aptdaemon.client.rst +@@ -91,7 +91,7 @@ code in a synchronous way: + ... transaction = yield apt_client.update() + ... except errors.NotAuthorizedError: + ... print "You are not allowed to update the cache!" +- ... raise StopIteration ++ ... return + ... yield transaction.set_locale("de_DE") + ... yield transaction.run() + ... print "Transaction has started" |