From e8dfd169afd1dd75bb53624ee3ebeda1093f4089 Mon Sep 17 00:00:00 2001 From: decalage2 Date: Sun, 26 May 2019 21:22:33 +0200 Subject: [PATCH] olevba: moved import pcodedmp to avoid circular imports --- oletools/olevba.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/oletools/olevba.py b/oletools/olevba.py index 96b5c3c..ea611d6 100644 --- a/oletools/olevba.py +++ b/oletools/olevba.py @@ -286,7 +286,6 @@ except ImportError: + "or http://effbot.org/zone/element-index.htm") import colorclass -from pcodedmp import pcodedmp # On Windows, colorclass needs to be enabled: if os.name == 'nt': @@ -3603,6 +3602,8 @@ class VBA_Parser_CLI(VBA_Parser): log.info('Error parsing form: %s' % exc) log.debug('Traceback:', exc_info=True) if pcode: + # import pcodedmp here to avoid circular imports: + from pcodedmp import pcodedmp print('-' * 79) print('P-CODE disassembly:') # pcodedmp prints all its output to sys.stdout, so we need to capture it so that -- libgit2 0.21.4