From 334c0e966eeb67cc88975cc51c3b7e17f7d1b1ee Mon Sep 17 00:00:00 2001 From: Andrew Lamoureux Date: Sat, 23 Mar 2019 01:15:14 -0400 Subject: kaitai: python3-compatible forgiveness for struct properties hasattr() on python2 has built in exception handler that would return False when computation of a property screwed up - that doesnt exist in python3 --- python/examples/kaitai/view.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'python/examples/kaitai/view.py') diff --git a/python/examples/kaitai/view.py b/python/examples/kaitai/view.py index a30140c0..75952b9b 100644 --- a/python/examples/kaitai/view.py +++ b/python/examples/kaitai/view.py @@ -137,7 +137,7 @@ class KaitaiView(QScrollArea, View): # parse the file using Kaitai, construct the TreeWidget def kaitaiParse(self, ksModuleName=None): - #log_debug('kaitaiParse() with len(bv)=%d and bv.file.filename=%s' % (len(self.binaryView), self.binaryView.file.filename)) + log.log_debug('kaitaiParse() with len(bv)=%d and bv.file.filename=%s' % (len(self.binaryView), self.binaryView.file.filename)) if len(self.binaryView) == 0: return @@ -155,7 +155,7 @@ class KaitaiView(QScrollArea, View): tree = kshelpers.buildQtree(parsed) except Exception as e: log.log_error('kaitai module %s threw exception, check file type' % ksModuleName) - true = None + tree = None else: tree = kshelpers.buildQtree(parsed) -- cgit v1.3.1