Gentoo Archives: gentoo-portage-dev

From: Alexandru Elisei <alexandru.elisei@×××××.com>
To: gentoo-portage-dev@l.g.o
Subject: [gentoo-portage-dev] [PATCH] sync.py: set returncode when task failed in SyncScheduler._task_exit()
Date: Thu, 26 Jan 2017 19:00:14
Message-Id: CAB-4s4=QWYy-YH7w5_h_B+D0cFn5vjfhRPbXR8oD17pLdvvZWQ@mail.gmail.com
1 If task.returncode is not os.EX_OK then returncode isn't defined when
2 trying to append the (repo, returncode) tuple to self.retvals. This will
3 raise an UnboundLocalError exception.
4
5 This reverts the changes to the function made by commit f143e58.
6 ---
7 pym/portage/emaint/modules/sync/sync.py | 1 +
8 1 file changed, 1 insertion(+)
9
10 diff --git a/pym/portage/emaint/modules/sync/sync.py
11 b/pym/portage/emaint/modules/sync/sync.py
12 index b190b3c..076297a 100644
13 --- a/pym/portage/emaint/modules/sync/sync.py
14 +++ b/pym/portage/emaint/modules/sync/sync.py
15 @@ -362,6 +362,7 @@ class SyncScheduler(AsyncScheduler):
16 # that hooks will be called in a backward-compatible manner
17 # even if all sync tasks have failed.
18 hooks_enabled = True
19 + returncode = task.returncode
20 if task.returncode == os.EX_OK:
21 returncode, message, updatecache_flg, hooks_enabled = task.result
22 if message:
23 --
24 2.10.2

Replies