diff options
author | Zac Medico <zmedico@gentoo.org> | 2018-04-28 14:51:01 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2018-04-28 14:55:46 -0700 |
commit | 27801746e9aa7e9ffc02408b2b005aa106c0d8a7 (patch) | |
tree | 748a6b4deb1892f2ca4848ab5418eb71da22d3a2 | |
parent | MetadataRegen: fix deprecated _wait usage (bug 653856) (diff) | |
download | portage-27801746.tar.gz portage-27801746.tar.bz2 portage-27801746.zip |
MirrorDistTask: fix deprecated _wait usage (bug 653856)
Override AsynchronousTask._async_wait() for cleanup, since
AsynchronousTask._wait() is deprecated.
Bug: https://bugs.gentoo.org/653856
-rw-r--r-- | pym/portage/_emirrordist/MirrorDistTask.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/pym/portage/_emirrordist/MirrorDistTask.py b/pym/portage/_emirrordist/MirrorDistTask.py index 48d0f7cf2..a0912d673 100644 --- a/pym/portage/_emirrordist/MirrorDistTask.py +++ b/pym/portage/_emirrordist/MirrorDistTask.py @@ -1,4 +1,4 @@ -# Copyright 2013-2014 Gentoo Foundation +# Copyright 2013-2018 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import errno @@ -46,7 +46,7 @@ class MirrorDistTask(CompositeTask): self._assert_current(fetch) if self._was_cancelled(): - self.wait() + self._async_wait() return if self._config.options.delete: @@ -63,7 +63,7 @@ class MirrorDistTask(CompositeTask): self._assert_current(deletion) if self._was_cancelled(): - self.wait() + self._async_wait() return self._post_deletion() @@ -80,7 +80,7 @@ class MirrorDistTask(CompositeTask): self.returncode = os.EX_OK self._current_task = None - self.wait() + self._async_wait() def _update_recycle_db(self): @@ -242,5 +242,15 @@ class MirrorDistTask(CompositeTask): self._async_wait() def _wait(self): + """ + Deprecated. Use _async_wait() instead. + """ CompositeTask._wait(self) self._cleanup() + + def _async_wait(self): + """ + Override _async_wait to call self._cleanup(). + """ + self._cleanup() + super(CompositeTask, self)._async_wait() |