From b22f8572873374875f62c6a8794d5937692afe06 Mon Sep 17 00:00:00 2001 From: Peter Foley Date: Wed, 12 Apr 2017 02:48:48 -0400 Subject: [PATCH] Prevent crash if os.nice() fails If settings["PORTAGE_NICENESS"] is undefined, portage crashes with a KeyError when trying to print the error. Signed-off-by: Peter Foley X-Gentoo-bug: 615328 X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=615328 --- pym/_emerge/actions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index 818fab90a..1bc20c3ed 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -2553,7 +2553,7 @@ def nice(settings): except (OSError, ValueError) as e: out = portage.output.EOutput() out.eerror("Failed to change nice value to '%s'" % \ - settings["PORTAGE_NICENESS"]) + settings.get("PORTAGE_NICENESS", "0")) out.eerror("%s\n" % str(e)) def ionice(settings): -- 2.12.2