dpp-nfc: More robust determination of the script directory

Make it more robust to import wpaspy regardless of how dpp-nfc.py is
being executed.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
Jouni Malinen 2020-05-14 21:29:25 +03:00 committed by Jouni Malinen
parent 47323a6f50
commit f85fb349fd
1 changed files with 1 additions and 1 deletions

View File

@ -18,7 +18,7 @@ import ndef
import logging
scriptsdir = os.path.dirname(os.path.realpath("dpp-nfc.py"))
scriptsdir = os.path.dirname(os.path.realpath(sys.modules[__name__].__file__))
sys.path.append(os.path.join(scriptsdir, '..', '..', 'wpaspy'))
import wpaspy