diff options
| author | Bob Halley <halley@dnspython.org> | 2020-07-24 18:10:01 -0700 |
|---|---|---|
| committer | Bob Halley <halley@dnspython.org> | 2020-07-24 18:10:01 -0700 |
| commit | 7f0c4c507c1be2be80750816503ee1f78a2f3ec7 (patch) | |
| tree | fae2a1cc07a9c1da1adec6674d15e8bc46b3163f /dns/zone.py | |
| parent | 4ca4799d451d82b80f34c4990bb37c6acc607d20 (diff) | |
| download | dnspython-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.py | 6 |
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) |
