1 |
commit: e9cd44dbd0366267b8b6beb011d91a9f99fed3cd |
2 |
Author: Peter Foley <pefoley2 <AT> pefoley <DOT> com> |
3 |
AuthorDate: Wed Apr 12 06:48:48 2017 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Apr 12 16:43:52 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=e9cd44db |
7 |
|
8 |
Prevent crash if os.nice() fails |
9 |
|
10 |
If settings["PORTAGE_NICENESS"] is undefined, portage crashes with a |
11 |
KeyError when trying to print the error. |
12 |
|
13 |
Signed-off-by: Peter Foley <pefoley2 <AT> pefoley.com> |
14 |
X-Gentoo-bug: 615328 |
15 |
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=615328 |
16 |
|
17 |
pym/_emerge/actions.py | 2 +- |
18 |
1 file changed, 1 insertion(+), 1 deletion(-) |
19 |
|
20 |
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py |
21 |
index 818fab90a..1bc20c3ed 100644 |
22 |
--- a/pym/_emerge/actions.py |
23 |
+++ b/pym/_emerge/actions.py |
24 |
@@ -2553,7 +2553,7 @@ def nice(settings): |
25 |
except (OSError, ValueError) as e: |
26 |
out = portage.output.EOutput() |
27 |
out.eerror("Failed to change nice value to '%s'" % \ |
28 |
- settings["PORTAGE_NICENESS"]) |
29 |
+ settings.get("PORTAGE_NICENESS", "0")) |
30 |
out.eerror("%s\n" % str(e)) |
31 |
|
32 |
def ionice(settings): |