Skip to content

Commit

Permalink
replace distutils for python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
branchvincent committed Feb 5, 2024
1 parent b0140e9 commit 5d0c482
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vpn_slice/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@ def get_default_providers():
prep = CheckTunDevProvider,
)
elif platform.startswith('darwin'):
from distutils.version import LooseVersion
from platform import release

from .dnspython import DNSPythonProvider
from .mac import BSDRouteProvider, MacSplitDNSProvider, PfFirewallProvider, PsProvider
from .posix import PosixHostsFileProvider
parsed_release = tuple(int(d) if d.isdigit() else 0 for d in release().split("."))
return dict(
process=PsProvider,
route=BSDRouteProvider,
dns=DNSPythonProvider or DigProvider,
hosts=PosixHostsFileProvider,
domain_vpn_dns=MacSplitDNSProvider,
firewall = PfFirewallProvider if release() >= LooseVersion('10.6') else None,
firewall = PfFirewallProvider if parsed_release >= (10, 6) else None,
)
elif platform.startswith('freebsd'):
from .dnspython import DNSPythonProvider
Expand Down

0 comments on commit 5d0c482

Please sign in to comment.