chore: import sys only when necessary
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
"""Script to extract the configuration json schema from config_schema.py file."""
|
"""Script to extract the configuration json schema from config_schema.py file."""
|
||||||
|
|
||||||
import sys
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import rapidjson
|
import rapidjson
|
||||||
@@ -13,6 +12,8 @@ def extract_config_json_schema():
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
# If freqtrade is not installed, add the parent directory to sys.path
|
# If freqtrade is not installed, add the parent directory to sys.path
|
||||||
# to import directly from the source
|
# to import directly from the source
|
||||||
|
import sys
|
||||||
|
|
||||||
script_dir = Path(__file__).parent
|
script_dir = Path(__file__).parent
|
||||||
freqtrade_dir = script_dir.parent
|
freqtrade_dir = script_dir.parent
|
||||||
sys.path.insert(0, str(freqtrade_dir))
|
sys.path.insert(0, str(freqtrade_dir))
|
||||||
|
|||||||
Reference in New Issue
Block a user