[diffoscope] 01/02: Omit misleading "any of" prefix when only complaining about one module.
Chris Lamb
chris at chris-lamb.co.uk
Mon Oct 9 20:44:55 CEST 2017
This is an automated email from the git hooks/post-receive script.
lamby pushed a commit to branch master
in repository diffoscope.
commit 71493966ac0fb6d76d6e989912da4031766a388b
Author: Chris Lamb <lamby at debian.org>
Date: Mon Oct 9 19:36:47 2017 +0100
Omit misleading "any of" prefix when only complaining about one module.
---
diffoscope/comparators/__init__.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/diffoscope/comparators/__init__.py b/diffoscope/comparators/__init__.py
index 3a691f2..9b4791c 100644
--- a/diffoscope/comparators/__init__.py
+++ b/diffoscope/comparators/__init__.py
@@ -116,8 +116,9 @@ class ComparatorManager(object):
self.classes.append(getattr(mod, klass_name))
break
else: # noqa
- raise ImportError(
- "Could not import any of {}".format(', '.join(xs))
- )
+ raise ImportError("Could not import {}{}".format(
+ "any of" if len(xs) > 1 else '',
+ ', '.join(xs)
+ ))
logger.debug("Loaded %d comparator classes", len(self.classes))
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git
More information about the diffoscope
mailing list