Commit 7df8aab0242d06605b2e629547247aa8311fbc0c

Authored by decalage2
1 parent 96f2cffd

olevba: another slight fix to avoid a test to fail by mistake

Showing 1 changed file with 3 additions and 2 deletions
oletools/olevba.py
@@ -3442,10 +3442,11 @@ class VBA_Parser(object): @@ -3442,10 +3442,11 @@ class VBA_Parser(object):
3442 # import pcodedmp here to avoid circular imports: 3442 # import pcodedmp here to avoid circular imports:
3443 try: 3443 try:
3444 from pcodedmp import pcodedmp 3444 from pcodedmp import pcodedmp
3445 - except Exception: 3445 + except Exception as e:
3446 # This may happen with Pypy, because pcodedmp imports win_unicode_console... 3446 # This may happen with Pypy, because pcodedmp imports win_unicode_console...
3447 # TODO: this is a workaround, we just ignore P-code 3447 # TODO: this is a workaround, we just ignore P-code
3448 - log.exception('Exception when importing pcodedmp') 3448 + # TODO: here we just use log.warning, because the word "error" in the output makes some of the tests fail...
  3449 + log.warning('Exception when importing pcodedmp: {}'.format(e))
3449 self.pcodedmp_output = '' 3450 self.pcodedmp_output = ''
3450 return '' 3451 return ''
3451 # logging is disabled after importing pcodedmp, need to re-enable it 3452 # logging is disabled after importing pcodedmp, need to re-enable it