fix python import of non-gui builds

This commit is contained in:
mhochsteger@cerbsim.com 2021-11-09 09:15:55 +01:00
parent ffdb9378b5
commit 81c1d46db0

View File

@ -16,9 +16,11 @@ del os
from . import libngpy
_Redraw = libngpy.meshvis._Redraw
if config.USE_GUI:
global _Redraw, Redraw
_Redraw = libngpy.meshvis._Redraw
def RedrawWithEventHandling(*args, **kwargs):
def RedrawWithEventHandling(*args, **kwargs):
try:
if libngpy.meshvis._Redraw(*args, **kwargs):
import netgen
@ -29,4 +31,4 @@ def RedrawWithEventHandling(*args, **kwargs):
except:
pass
Redraw = RedrawWithEventHandling
Redraw = RedrawWithEventHandling