From e5389be209d04e012cac5692e61ed51383640656 Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 4 Apr 2025 09:32:16 +0200 Subject: [PATCH] chore: import sys only when necessary --- build_helpers/extract_config_json_schema.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build_helpers/extract_config_json_schema.py b/build_helpers/extract_config_json_schema.py index ff568d5b6..15bfd7720 100644 --- a/build_helpers/extract_config_json_schema.py +++ b/build_helpers/extract_config_json_schema.py @@ -1,6 +1,5 @@ """Script to extract the configuration json schema from config_schema.py file.""" -import sys from pathlib import Path import rapidjson @@ -13,6 +12,8 @@ def extract_config_json_schema(): except ImportError: # If freqtrade is not installed, add the parent directory to sys.path # to import directly from the source + import sys + script_dir = Path(__file__).parent freqtrade_dir = script_dir.parent sys.path.insert(0, str(freqtrade_dir))