[diffoscope] 05/05: comparators.utils: Tidy code that calls cmp(1)
Chris Lamb
chris at chris-lamb.co.uk
Tue Feb 7 04:32:28 CET 2017
This is an automated email from the git hooks/post-receive script.
lamby pushed a commit to branch master
in repository diffoscope.
commit 03b8f8910a7c44ead996cbcf94644dc89807ac48
Author: Chris Lamb <lamby at debian.org>
Date: Tue Feb 7 15:41:05 2017 +1300
comparators.utils: Tidy code that calls cmp(1)
Signed-off-by: Chris Lamb <lamby at debian.org>
---
diffoscope/comparators/utils/file.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/diffoscope/comparators/utils/file.py b/diffoscope/comparators/utils/file.py
index 3db6346..538cafa 100644
--- a/diffoscope/comparators/utils/file.py
+++ b/diffoscope/comparators/utils/file.py
@@ -224,9 +224,11 @@ class File(object, metaclass=abc.ABCMeta):
@tool_required('cmp')
def cmp_external(self, other):
- return 0 == subprocess.call(['cmp', '-s', self.path, other.path],
- shell=False, close_fds=True)
-
+ return subprocess.call(
+ ('cmp', '-s', self.path, other.path),
+ shell=False,
+ close_fds=True,
+ ) == 0
# To be specialized directly, or by implementing compare_details
def compare(self, other, source=None):
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git
More information about the diffoscope
mailing list