]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
to_text() always returns a str, so no need to check if it is not a str
authorBob Halley <halley@dnspython.org>
Sat, 25 Jul 2020 01:10:01 +0000 (18:10 -0700)
committerBob Halley <halley@dnspython.org>
Sat, 25 Jul 2020 01:10:01 +0000 (18:10 -0700)
dns/zone.py

index eee5fdb691b10dd44d0477a3e9cb4455bc304561..ad597e9bc6a6cebc168df88362df94f67371c4a9 100644 (file)
@@ -586,11 +586,7 @@ class Zone:
                 l = self[n].to_text(n, origin=self.origin,
                                     relativize=relativize,
                                     want_comments=want_comments)
-                if isinstance(l, str):
-                    l_b = l.encode(file_enc)
-                else:
-                    l_b = l
-                    l = l.decode()
+                l_b = l.encode(file_enc)
 
                 try:
                     f.write(l_b)