Commit e8dfd169afd1dd75bb53624ee3ebeda1093f4089

Authored by decalage2
1 parent ea91bcc2

olevba: moved import pcodedmp to avoid circular imports

Showing 1 changed file with 2 additions and 1 deletions
oletools/olevba.py
@@ -286,7 +286,6 @@ except ImportError: @@ -286,7 +286,6 @@ except ImportError:
286 + "or http://effbot.org/zone/element-index.htm") 286 + "or http://effbot.org/zone/element-index.htm")
287 287
288 import colorclass 288 import colorclass
289 -from pcodedmp import pcodedmp  
290 289
291 # On Windows, colorclass needs to be enabled: 290 # On Windows, colorclass needs to be enabled:
292 if os.name == 'nt': 291 if os.name == 'nt':
@@ -3603,6 +3602,8 @@ class VBA_Parser_CLI(VBA_Parser): @@ -3603,6 +3602,8 @@ class VBA_Parser_CLI(VBA_Parser):
3603 log.info('Error parsing form: %s' % exc) 3602 log.info('Error parsing form: %s' % exc)
3604 log.debug('Traceback:', exc_info=True) 3603 log.debug('Traceback:', exc_info=True)
3605 if pcode: 3604 if pcode:
  3605 + # import pcodedmp here to avoid circular imports:
  3606 + from pcodedmp import pcodedmp
3606 print('-' * 79) 3607 print('-' * 79)
3607 print('P-CODE disassembly:') 3608 print('P-CODE disassembly:')
3608 # pcodedmp prints all its output to sys.stdout, so we need to capture it so that 3609 # pcodedmp prints all its output to sys.stdout, so we need to capture it so that