plugins/python/example_{io,conversation}: avoid printing signal number

They are platform dependant, so their test would fail on some platforms.
While we could create separate plugin for the tests, I like the idea that
the examples are ensured to be working.

I believe this is a good compromise for being able to auto update the
test cases.
This commit is contained in:
Robert Manner
2020-01-14 13:50:19 +01:00
committed by Todd C. Miller
parent 40f2189586
commit f3b7f3c0d4
5 changed files with 7 additions and 8 deletions

View File

@@ -99,8 +99,7 @@ class SudoIOPlugin(sudo.Plugin):
def log_suspend(self, signo: int) -> int:
try:
signal_name = signal.Signals(signo).name
signal_description = "{} ({})".format(signal_name, signo)
signal_description = signal.Signals(signo).name
except (AttributeError, ValueError):
signal_description = "signal {}".format(signo)