Skip to content

Commit 588fdbd

Browse files
authored
Merge pull request #38 from oycillessen/master
Linux: Fix the problem that can't operate the second wireless card
2 parents c6ec3ea + c167d7e commit 588fdbd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pywifi/_wifiutil_linux.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def interfaces(self):
245245
"""Get the wifi interface lists."""
246246

247247
ifaces = []
248-
for f in os.listdir(CTRL_IFACE_DIR):
248+
for f in sorted(os.listdir(CTRL_IFACE_DIR)):
249249
sock_file = '/'.join([CTRL_IFACE_DIR, f])
250250
mode = os.stat(sock_file).st_mode
251251
if stat.S_ISSOCK(mode):
@@ -264,7 +264,7 @@ def _connect_to_wpa_s(self, iface):
264264
"Connection for iface '%s' aleady existed!",
265265
iface)
266266

267-
sock_file = '{}/{}_{}'.format('/tmp', 'pywifi', 'iface')
267+
sock_file = '{}/{}_{}'.format('/tmp', 'pywifi', iface)
268268
self._remove_existed_sock(sock_file)
269269
sock = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
270270
sock.bind(sock_file)

0 commit comments

Comments
 (0)