Skip to content

Commit e87f811

Browse files
committed
macOS: catch removed Airport macOS 14.4+ issue
1 parent 8699af7 commit e87f811

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/mozloc/cmd.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import os
44
import functools
55
import shutil
6+
import subprocess
67

78

89
def running_as_root() -> bool:
@@ -17,11 +18,17 @@ def get_exe(name: str, path: str | None = None) -> str:
1718

1819

1920
def get_airport() -> str:
20-
return get_exe(
21+
exe = get_exe(
2122
"airport",
2223
"/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources",
2324
)
2425

26+
msg = subprocess.check_output(exe, text=True, timeout=10)
27+
if "WARNING: The airport command line tool is deprecated" in msg:
28+
raise EnvironmentError(msg)
29+
30+
return exe
31+
2532

2633
def get_nmcli() -> str:
2734
return get_exe("nmcli")

0 commit comments

Comments
 (0)