Fix Country Code detection

Closes https://github.com/dortania/OpenCore-Legacy-Patcher/issues/184
This commit is contained in:
Mykola Grymalyuk
2021-06-18 19:08:01 -06:00
parent c5fd4036a7
commit 292e09a0d7
3 changed files with 17 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
import binascii
import enum
import itertools
import plistlib
import subprocess
from dataclasses import dataclass, field
from typing import Any, ClassVar, Optional, Type
@@ -104,7 +105,7 @@ class WirelessCard(PCIDevice):
chipset: enum.Enum = field(init=False)
def __post_init__(self):
system_profiler = plistlib.loads(subprocess.run("system_profiler -xml SPAirPortDataType", stdout=subprocess.PIPE).stdout)
system_profiler = plistlib.loads(subprocess.run("system_profiler -xml SPAirPortDataType".split(), stdout=subprocess.PIPE).stdout)
self.country_code = system_profiler[0]["_items"][0]["spairport_airport_interfaces"][0]["spairport_wireless_country_code"]
self.detect_chipset()