diff --git a/InteractiveHtmlBom/__init__.py b/InteractiveHtmlBom/__init__.py index f171a41..33c9ac0 100644 --- a/InteractiveHtmlBom/__init__.py +++ b/InteractiveHtmlBom/__init__.py @@ -43,8 +43,11 @@ def callback(_): top_tb.Realize() +# sys.argv[0] is '-m' while this package is imported by +# "python -m InteractiveHtmlBom.generate_interactive_bom" if (not os.environ.get('INTERACTIVE_HTML_BOM_CLI_MODE', False) and - not os.path.basename(sys.argv[0]).startswith('generate_interactive_bom')): + not os.path.basename(sys.argv[0]).startswith('generate_interactive_bom') and + sys.argv[0] != '-m'): from .ecad.kicad import InteractiveHtmlBomPlugin plugin = InteractiveHtmlBomPlugin()