From: Bob Halley Date: Fri, 5 Dec 2025 23:48:37 +0000 (-0800) Subject: improve typing and remove unneeded assignments X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe79566ba65404029f249f9b7b665019b2fa25ed;p=thirdparty%2Fdnspython.git improve typing and remove unneeded assignments --- diff --git a/dns/zonefile.py b/dns/zonefile.py index 78fd13e2..4654446c 100644 --- a/dns/zonefile.py +++ b/dns/zonefile.py @@ -152,7 +152,7 @@ class Reader: def _rr_line(self): """Process one line from a DNS zone file.""" - token = None + token: dns.tokenizer.Token # Name if self.force_name is not None: name = self.force_name @@ -190,7 +190,6 @@ class Reader: ttl = dns.ttl.from_text(token.value) self.last_ttl = ttl self.last_ttl_known = True - token = None except dns.ttl.BadTTL: self.tok.unget(token) @@ -212,12 +211,10 @@ class Reader: if ttl is None: # support for syntax token = self._get_identifier() - ttl = None try: ttl = dns.ttl.from_text(token.value) self.last_ttl = ttl self.last_ttl_known = True - token = None except dns.ttl.BadTTL: if self.default_ttl_known: ttl = self.default_ttl