Skip to content

Commit

Permalink
nanovna-saver.py: fix execution from outside source directory (#632)
Browse files Browse the repository at this point in the history
nanovna-saver.py can be called from outside the source directory. The
module import path needs to be resolved relative to the source
directory, not relative to the current working directory of the
process.

Fixes: b011000 ("moved to pyscaffold directory structure")
  • Loading branch information
silbe authored May 2, 2023
1 parent 8f86722 commit 9b4575e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nanovna-saver.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.

from contextlib import suppress
import os

# noinspection PyUnresolvedReferences
with suppress(ImportError):
Expand All @@ -29,7 +30,7 @@
except ModuleNotFoundError:
import sys

sys.path.append("src")
sys.path.append(os.path.join(os.path.dirname(__file__), "src"))
from NanoVNASaver.__main__ import main


Expand Down

0 comments on commit 9b4575e

Please sign in to comment.