From: Jouni Malinen Date: Thu, 14 May 2020 18:29:25 +0000 (+0300) Subject: dpp-nfc: More robust determination of the script directory X-Git-Tag: hostap_2_10~1319 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f85fb349fd7452b2a15feefd66b466d7714e6661;p=thirdparty%2Fhostap.git 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 --- diff --git a/wpa_supplicant/examples/dpp-nfc.py b/wpa_supplicant/examples/dpp-nfc.py index 173416794..e448315ba 100755 --- a/wpa_supplicant/examples/dpp-nfc.py +++ b/wpa_supplicant/examples/dpp-nfc.py @@ -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