Skip to content

Commit

Permalink
use methods with appropriate rcode/opcode typecasting in Message.to_t…
Browse files Browse the repository at this point in the history
…ext()
  • Loading branch information
rthalley committed Jan 4, 2021
1 parent 5103169 commit 1b2b550
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions dns/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,8 @@ def to_text(self, origin=None, relativize=True, **kw):

s = io.StringIO()
s.write('id %d\n' % self.id)
s.write('opcode %s\n' %
dns.opcode.to_text(dns.opcode.from_flags(self.flags)))
rc = dns.rcode.from_flags(self.flags, self.ednsflags)
s.write('rcode %s\n' % dns.rcode.to_text(rc))
s.write('opcode %s\n' % dns.opcode.to_text(self.opcode()))
s.write('rcode %s\n' % dns.rcode.to_text(self.rcode()))
s.write('flags %s\n' % dns.flags.to_text(self.flags))
if self.edns >= 0:
s.write('edns %s\n' % self.edns)
Expand Down

0 comments on commit 1b2b550

Please sign in to comment.