]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Update zone.py
authortmerila <tuomas@merila.org>
Wed, 3 Apr 2019 11:28:22 +0000 (14:28 +0300)
committerGitHub <noreply@github.com>
Wed, 3 Apr 2019 11:28:22 +0000 (14:28 +0300)
Need to also check that last TTL is known before using it as a fallback, otherwise ttl is never None in the last check, setting it incorrectly to 0 instead.

dns/zone.py

index 2b9157b956e3f8f2c5fd1c1f6db1e652e1edd94d..7f5cb60d9ff1b63044d4f63fcc6e5b30a509dcd3 100644 (file)
@@ -814,7 +814,7 @@ class _MasterReader(object):
                 raise dns.exception.SyntaxError("Missing default TTL value")
             if self.default_ttl_known:
                 ttl = self.default_ttl
-            else:
+            elif self.last_ttl_known:
                 ttl = self.last_ttl
         # Class
         try: