summaryrefslogtreecommitdiff
path: root/dns/zone.py
diff options
context:
space:
mode:
authorBob Halley <halley@dnspython.org>2020-07-24 18:10:01 -0700
committerBob Halley <halley@dnspython.org>2020-07-24 18:10:01 -0700
commit7f0c4c507c1be2be80750816503ee1f78a2f3ec7 (patch)
treefae2a1cc07a9c1da1adec6674d15e8bc46b3163f /dns/zone.py
parent4ca4799d451d82b80f34c4990bb37c6acc607d20 (diff)
downloaddnspython-7f0c4c507c1be2be80750816503ee1f78a2f3ec7.tar.gz
to_text() always returns a str, so no need to check if it is not a str
Diffstat (limited to 'dns/zone.py')
-rw-r--r--dns/zone.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/dns/zone.py b/dns/zone.py
index eee5fdb..ad597e9 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)