nanovna-saver.py: fix execution from outside source directory (#632)

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: b0110002 ("moved to pyscaffold directory structure")
pull/634/head
Sascha Silbe 2023-05-02 11:12:21 +02:00 zatwierdzone przez GitHub
rodzic 8f86722c1e
commit 9b4575e307
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -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):
@ -29,7 +30,7 @@ try:
except ModuleNotFoundError:
import sys
sys.path.append("src")
sys.path.append(os.path.join(os.path.dirname(__file__), "src"))
from NanoVNASaver.__main__ import main