From: Bob Halley Date: Sat, 25 Jul 2020 01:10:01 +0000 (-0700) Subject: to_text() always returns a str, so no need to check if it is not a str X-Git-Tag: v2.1.0rc1~143 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f0c4c507c1be2be80750816503ee1f78a2f3ec7;p=thirdparty%2Fdnspython.git to_text() always returns a str, so no need to check if it is not a str --- diff --git a/dns/zone.py b/dns/zone.py index eee5fdb6..ad597e9b 100644 --- a/dns/zone.py +++ b/dns/zone.py @@ -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)