summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Halley <halley@dnspython.org>2021-01-04 14:34:45 -0800
committerBob Halley <halley@dnspython.org>2021-01-04 14:34:45 -0800
commit1b2b550f96e20a35b552cb2497c59d5e4e0fc9a6 (patch)
treed801c6d9d10d55b10c6cb5f3d8a21851e39abc80
parent5103169149bbf8fb1d5da803d4a408b7fefda511 (diff)
downloaddnspython-1b2b550f96e20a35b552cb2497c59d5e4e0fc9a6.tar.gz
use methods with appropriate rcode/opcode typecasting in Message.to_text()
-rw-r--r--dns/message.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/dns/message.py b/dns/message.py
index 131f1f3..2a7565a 100644
--- a/dns/message.py
+++ b/dns/message.py
@@ -186,10 +186,8 @@ class Message:
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)