소스 검색

use psutil for mac detection

Alex Cheema 5 달 전
부모
커밋
f4619d467b
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      exo/helpers.py

+ 1 - 1
exo/helpers.py

@@ -247,7 +247,7 @@ def get_interface_priority_and_type(ifname: str) -> Tuple[int, str]:
     return (6, "Loopback")
     return (6, "Loopback")
 
 
   # On macOS, use networksetup to accurately identify interface types
   # On macOS, use networksetup to accurately identify interface types
-  if platform.system() == 'Darwin':
+  if psutil.MACOS:
     try:
     try:
       import subprocess
       import subprocess
       result = subprocess.run(['networksetup', '-listallhardwareports'], capture_output=True, text=True)
       result = subprocess.run(['networksetup', '-listallhardwareports'], capture_output=True, text=True)