From f85fb349fd7452b2a15feefd66b466d7714e6661 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 14 May 2020 21:29:25 +0300 Subject: [PATCH] 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 --- wpa_supplicant/examples/dpp-nfc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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