From 8e5adc0678761dec57734fbae1d5bf36857ee872 Mon Sep 17 00:00:00 2001 From: Bob Halley Date: Fri, 17 Dec 2021 05:44:08 -0800 Subject: [PATCH] lint and remove unused helpers --- dns/win32util.py | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/dns/win32util.py b/dns/win32util.py index b2300dd7..05e21638 100755 --- a/dns/win32util.py +++ b/dns/win32util.py @@ -24,7 +24,7 @@ if sys.platform == 'win32': # Windows just stores such values in the registry (see #687). # Check for this and fix it. if domain.startswith('.'): - domain = domain[1:] + domain = domain[1:] return dns.name.from_text(domain) class DnsInfo: @@ -59,16 +59,9 @@ if sys.platform == 'win32': self.start() self.join() return self.info - - - def get_dns_info_from_wmi(): - getter = _WMIGetter() - return getter.get() else: class _WMIGetter: pass - def get(self): - return None class _RegistryGetter: @@ -104,7 +97,7 @@ if sys.platform == 'win32': s = dns.name.from_text(s) if s not in self.info.search: self.info.search.append(s) - + def _config_fromkey(self, key, always_try_domain): try: servers, _ = winreg.QueryValueEx(key, 'NameServer') @@ -231,11 +224,6 @@ if sys.platform == 'win32': lm.Close() return self.info - def get_dns_info_from_registry(): - """Extract resolver configuration from the Windows registry.""" - getter = _RegistryGetter() - return getter.get() - if _have_wmi and _prefer_wmi: _getter_class = _WMIGetter else: @@ -245,4 +233,3 @@ if sys.platform == 'win32': """Extract resolver configuration.""" getter = _getter_class() return getter.get() - -- 2.47.3