From ce90bf8775765ae6b0b4176c2cae6ddd41bd07dd Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Tue, 27 Aug 2019 16:31:34 +0200 Subject: [PATCH] Don't import tkinter when Netgen is loaded --- python/CMakeLists.txt | 5 ----- python/__init__.py | 4 ---- 2 files changed, 9 deletions(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 477befea..4306194d 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -1,8 +1,3 @@ -if(USE_GUI) - set(IMPORT_TKINTER True) -else() - set(IMPORT_TKINTER False) -endif() configure_file(__init__.py ${CMAKE_CURRENT_BINARY_DIR}/__init__.py @ONLY) install(FILES diff --git a/python/__init__.py b/python/__init__.py index 5c8f2dc3..e74d1a49 100644 --- a/python/__init__.py +++ b/python/__init__.py @@ -1,10 +1,6 @@ import os import sys -# import tkinter only if Netgen was configured with USE_GUI=ON -if @IMPORT_TKINTER@: - import tkinter - _netgen_bin_dir=os.path.realpath(os.path.join(os.path.dirname(__file__),'..','@NETGEN_PYTHON_RPATH_BIN@')) _netgen_lib_dir=os.path.realpath(os.path.join(os.path.dirname(__file__),'..','@NETGEN_PYTHON_RPATH@'))