[diffoscope] 02/02: comparators.utils.file: If we don't have a tool (eg. apktool), don't blow up when attempting to unpack it.

Chris Lamb chris at chris-lamb.co.uk
Sat Jan 7 19:43:38 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 1d69f42b00fa6f05ca1a4ab8c5c90491f9676327
Author: Chris Lamb <lamby at debian.org>
Date:   Sat Jan 7 18:43:34 2017 +0000

    comparators.utils.file: If we don't have a tool (eg. apktool), don't blow up when attempting to unpack it.
    
    Signed-off-by: Chris Lamb <lamby at debian.org>
---
 diffoscope/comparators/utils/file.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/diffoscope/comparators/utils/file.py b/diffoscope/comparators/utils/file.py
index bf634ac..1cf1598 100644
--- a/diffoscope/comparators/utils/file.py
+++ b/diffoscope/comparators/utils/file.py
@@ -105,7 +105,10 @@ class File(object, metaclass=abc.ABCMeta):
             return None
         if not hasattr(self, '_as_container'):
             logger.debug('instantiating %s for %s', self.__class__.CONTAINER_CLASS, self)
-            self._as_container = self.__class__.CONTAINER_CLASS(self)
+            try:
+                self._as_container = self.__class__.CONTAINER_CLASS(self)
+            except RequiredToolNotFound as e:
+                return None
         logger.debug('returning a %s for %s', self._as_container.__class__, self)
         return self._as_container
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git


More information about the diffoscope mailing list