kopia lustrzana https://github.com/NanoVNA-Saver/nanovna-saver
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
rodzic
8f86722c1e
commit
9b4575e307
|
@ -17,6 +17,7 @@
|
||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from contextlib import suppress
|
from contextlib import suppress
|
||||||
|
import os
|
||||||
|
|
||||||
# noinspection PyUnresolvedReferences
|
# noinspection PyUnresolvedReferences
|
||||||
with suppress(ImportError):
|
with suppress(ImportError):
|
||||||
|
@ -29,7 +30,7 @@ try:
|
||||||
except ModuleNotFoundError:
|
except ModuleNotFoundError:
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
sys.path.append("src")
|
sys.path.append(os.path.join(os.path.dirname(__file__), "src"))
|
||||||
from NanoVNASaver.__main__ import main
|
from NanoVNASaver.__main__ import main
|
||||||
|
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue