From 9c6ac07cfb02cb0ac10cfabd191cec991b30ef7e Mon Sep 17 00:00:00 2001 From: Thomas BAUDIER Date: Fri, 4 Jul 2025 15:29:23 +0200 Subject: [PATCH] Remove old function not usefull for qt and mac --- opengate/__init__.py | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/opengate/__init__.py b/opengate/__init__.py index c23c0cc20..3fc89a0ec 100644 --- a/opengate/__init__.py +++ b/opengate/__init__.py @@ -62,38 +62,6 @@ def is_developer_installation(): return True -def restart_with_qt_libs(): - """ - Restart the current process with QT libs set. - Only for mac and wheel installation - """ - - if is_developer_installation(): - # we cannot know the real plugin_path nor if DYLD_LIBRARY_PATH is already correctly set - # so we ignore. - return - - plugin_path = os.path.join(get_site_packages_dir(), "opengate_core/plugins") - - # do nothing if the plugin_path is already in the env - if ( - "DYLD_LIBRARY_PATH" in os.environ - and plugin_path in os.environ["DYLD_LIBRARY_PATH"] - ): - return - - # Otherwise, we set the env and try to restart the script - new_env = os.environ.copy() - if "DYLD_LIBRARY_PATH" in new_env: - new_env["DYLD_LIBRARY_PATH"] = plugin_path + new_env["DYLD_LIBRARY_PATH"] - else: - new_env["DYLD_LIBRARY_PATH"] = plugin_path - - # Restart the process with the new environment - # print(new_env["DYLD_LIBRARY_PATH"]) - os.execve(sys.executable, [sys.executable] + sys.argv, new_env) - - def restart_with_glibc_tunables(): """ Restart the current process with GLIBC_TUNABLES set. @@ -155,8 +123,6 @@ def restart_with_glibc_tunables(): if sys.platform.startswith("linux"): restart_with_glibc_tunables() -elif sys.platform.startswith("darwin"): - restart_with_qt_libs() # subpackages import opengate.sources