Skip to content

Commit fa1eda5

Browse files
committed
Disable asserts in non-gui mode
Fixes #362
1 parent b0da3ec commit fa1eda5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

InteractiveHtmlBom/generate_interactive_bom.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,14 @@ def to_utf(s):
2525
def main():
2626
create_wx_app = 'INTERACTIVE_HTML_BOM_NO_DISPLAY' not in os.environ
2727

28-
if create_wx_app:
29-
import wx
28+
import wx
3029

30+
if create_wx_app:
3131
app = wx.App()
32-
app.SetAssertMode(wx.APP_ASSERT_SUPPRESS)
32+
if hasattr(wx, "APP_ASSERT_SUPPRESS"):
33+
app.SetAssertMode(wx.APP_ASSERT_SUPPRESS)
34+
elif hasattr(wx, "DisableAsserts"):
35+
wx.DisableAsserts()
3336

3437
from .core import ibom
3538
from .core.config import Config

0 commit comments

Comments
 (0)