From 960f5565f0a85d47b0bbbef21c8e7de40e46a442 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Fri, 7 Jan 2022 17:33:57 -0300 Subject: [PATCH] Fixed modules load order in kiconf_init.py - Previous seems to fail in some environments --- tests/test_plot/kiconf_init.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/test_plot/kiconf_init.py b/tests/test_plot/kiconf_init.py index b489af6e..981d1d84 100755 --- a/tests/test_plot/kiconf_init.py +++ b/tests/test_plot/kiconf_init.py @@ -9,6 +9,10 @@ from unittest.mock import patch # Look for the 'utils' module from where the script is running prev_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +if prev_dir not in sys.path: + sys.path.insert(0, prev_dir) +# One more level for the project +prev_dir = os.path.dirname(prev_dir) if prev_dir not in sys.path: sys.path.insert(0, prev_dir) @@ -19,10 +23,6 @@ logger.setLevel(logging.DEBUG) # Utils import from utils import context -# One more level for the project -prev_dir = os.path.dirname(prev_dir) -if prev_dir not in sys.path: - sys.path.insert(0, prev_dir) from kibot.kicad.config import KiConf from kibot.gs import GS @@ -53,7 +53,6 @@ if context.ki5(): ki_path = pcbnew.GetKicadConfigPath() else: ki_path = pcbnew.SETTINGS_MANAGER.GetUserSettingsPath() - logger.error(ki_path) GS.kicad_conf_path = None if args.no_conf_path else ki_path