1 |
commit: 27801746e9aa7e9ffc02408b2b005aa106c0d8a7 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Apr 28 21:51:01 2018 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Apr 28 21:55:46 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=27801746 |
7 |
|
8 |
MirrorDistTask: fix deprecated _wait usage (bug 653856) |
9 |
|
10 |
Override AsynchronousTask._async_wait() for cleanup, since |
11 |
AsynchronousTask._wait() is deprecated. |
12 |
|
13 |
Bug: https://bugs.gentoo.org/653856 |
14 |
|
15 |
pym/portage/_emirrordist/MirrorDistTask.py | 18 ++++++++++++++---- |
16 |
1 file changed, 14 insertions(+), 4 deletions(-) |
17 |
|
18 |
diff --git a/pym/portage/_emirrordist/MirrorDistTask.py b/pym/portage/_emirrordist/MirrorDistTask.py |
19 |
index 48d0f7cf2..a0912d673 100644 |
20 |
--- a/pym/portage/_emirrordist/MirrorDistTask.py |
21 |
+++ b/pym/portage/_emirrordist/MirrorDistTask.py |
22 |
@@ -1,4 +1,4 @@ |
23 |
-# Copyright 2013-2014 Gentoo Foundation |
24 |
+# Copyright 2013-2018 Gentoo Foundation |
25 |
# Distributed under the terms of the GNU General Public License v2 |
26 |
|
27 |
import errno |
28 |
@@ -46,7 +46,7 @@ class MirrorDistTask(CompositeTask): |
29 |
|
30 |
self._assert_current(fetch) |
31 |
if self._was_cancelled(): |
32 |
- self.wait() |
33 |
+ self._async_wait() |
34 |
return |
35 |
|
36 |
if self._config.options.delete: |
37 |
@@ -63,7 +63,7 @@ class MirrorDistTask(CompositeTask): |
38 |
|
39 |
self._assert_current(deletion) |
40 |
if self._was_cancelled(): |
41 |
- self.wait() |
42 |
+ self._async_wait() |
43 |
return |
44 |
|
45 |
self._post_deletion() |
46 |
@@ -80,7 +80,7 @@ class MirrorDistTask(CompositeTask): |
47 |
|
48 |
self.returncode = os.EX_OK |
49 |
self._current_task = None |
50 |
- self.wait() |
51 |
+ self._async_wait() |
52 |
|
53 |
def _update_recycle_db(self): |
54 |
|
55 |
@@ -242,5 +242,15 @@ class MirrorDistTask(CompositeTask): |
56 |
self._async_wait() |
57 |
|
58 |
def _wait(self): |
59 |
+ """ |
60 |
+ Deprecated. Use _async_wait() instead. |
61 |
+ """ |
62 |
CompositeTask._wait(self) |
63 |
self._cleanup() |
64 |
+ |
65 |
+ def _async_wait(self): |
66 |
+ """ |
67 |
+ Override _async_wait to call self._cleanup(). |
68 |
+ """ |
69 |
+ self._cleanup() |
70 |
+ super(CompositeTask, self)._async_wait() |