[diffoscope] 03/05: Use dict.get fallback to shorten OS_NAMES lookup in --list-tools.
Chris Lamb
chris at chris-lamb.co.uk
Sat Aug 13 21:02:23 CEST 2016
This is an automated email from the git hooks/post-receive script.
lamby pushed a commit to branch master
in repository diffoscope.
commit db691fc020241f788bea67a3a588f3f9fd737a16
Author: Chris Lamb <lamby at debian.org>
Date: Sat Aug 13 19:54:15 2016 +0100
Use dict.get fallback to shorten OS_NAMES lookup in --list-tools.
Signed-off-by: Chris Lamb <lamby at debian.org>
---
diffoscope/main.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/diffoscope/main.py b/diffoscope/main.py
index 073aacb..9213bf0 100644
--- a/diffoscope/main.py
+++ b/diffoscope/main.py
@@ -149,7 +149,7 @@ class ListToolsAction(argparse.Action):
os_list = OS_NAMES.keys()
for os in os_list:
print()
- print("Available in {} packages:".format(OS_NAMES[os] if os in OS_NAMES else os))
+ print("Available in {} packages: ".format(OS_NAMES.get(os, os)))
print(', '.join(sorted(filter(None, { RequiredToolNotFound.PROVIDERS.get(k, {}).get(os, None) for k in tool_required.all }))))
sys.exit(0)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git
More information about the diffoscope
mailing list