From c167d7ecca2e32acafef23fc107166656545a0c2 Mon Sep 17 00:00:00 2001 From: Adol Date: Fri, 30 Nov 2018 14:13:25 +0800 Subject: [PATCH] Add files via upload --- pywifi/_wifiutil_linux.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pywifi/_wifiutil_linux.py b/pywifi/_wifiutil_linux.py index d923d95..2965f94 100755 --- a/pywifi/_wifiutil_linux.py +++ b/pywifi/_wifiutil_linux.py @@ -245,7 +245,7 @@ def interfaces(self): """Get the wifi interface lists.""" ifaces = [] - for f in os.listdir(CTRL_IFACE_DIR): + for f in sorted(os.listdir(CTRL_IFACE_DIR)): sock_file = '/'.join([CTRL_IFACE_DIR, f]) mode = os.stat(sock_file).st_mode if stat.S_ISSOCK(mode): @@ -264,7 +264,7 @@ def _connect_to_wpa_s(self, iface): "Connection for iface '%s' aleady existed!", iface) - sock_file = '{}/{}_{}'.format('/tmp', 'pywifi', 'iface') + sock_file = '{}/{}_{}'.format('/tmp', 'pywifi', iface) self._remove_existed_sock(sock_file) sock = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM) sock.bind(sock_file)