diff options
| author | Andrew Lamoureux <andrew@vector35.com> | 2019-03-23 01:15:14 -0400 |
|---|---|---|
| committer | Andrew Lamoureux <andrew@vector35.com> | 2019-03-23 01:15:14 -0400 |
| commit | 334c0e966eeb67cc88975cc51c3b7e17f7d1b1ee (patch) | |
| tree | fbee805aa70f1b85f4513f488df5e0683458da98 /python/examples/kaitai/view.py | |
| parent | af001b025b5aad5b205cb97977f3951fe6ef2a71 (diff) | |
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
Diffstat (limited to 'python/examples/kaitai/view.py')
| -rw-r--r-- | python/examples/kaitai/view.py | 4 |
1 files changed, 2 insertions, 2 deletions
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) |
