commit e28321d49aa0f2cb37b5d14fda3e0d5a09ac129a
parent 6ede731da4cca4ee2bea76d6d0b38b925d98df93
Author: Steven Atkinson <[email protected]>
Date: Tue, 23 Jul 2024 08:22:45 -0700
[BUGFIX] Correct OS environment variable for home directory on Windows (#444)
* Update __init__.py
Fix bug on Windows
* Update test_gui.py
Change test
Diffstat:
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/nam/train/gui/__init__.py b/nam/train/gui/__init__.py
@@ -38,8 +38,9 @@ def _apply_extensions():
import sys
# DRY: Make sure this matches the test!
+ home_path = os.environ["HOMEPATH"] if os.name == "nt" else os.environ["HOME"]
extensions_path = os.path.join(
- os.environ["HOME"], ".neural-amp-modeler", "extensions"
+ home_path, ".neural-amp-modeler", "extensions"
)
if not os.path.exists(extensions_path):
return
diff --git a/tests/test_nam/test_train/test_gui.py b/tests/test_nam/test_train/test_gui.py
@@ -27,8 +27,9 @@ def test_extensions():
Test that we can use a simple extension.
"""
# DRY: Make sure this matches the code!
- extensions_path = Path(
- os.path.join(os.environ["HOME"], ".neural-amp-modeler", "extensions")
+ home_path = os.environ["HOMEPATH"] if os.name == "nt" else os.environ["HOME"]
+ extensions_path = os.path.join(
+ home_path, ".neural-amp-modeler", "extensions"
)
def get_name():