]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
dpp-nfc: More robust determination of the script directory
authorJouni Malinen <jouni@codeaurora.org>
Thu, 14 May 2020 18:29:25 +0000 (21:29 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 14 May 2020 18:29:25 +0000 (21:29 +0300)
Make it more robust to import wpaspy regardless of how dpp-nfc.py is
being executed.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
wpa_supplicant/examples/dpp-nfc.py

index 17341679476e0009dbce630547346defca777730..e448315baefcc0e738c94456563c4e19387ec311 100755 (executable)
@@ -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