summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Halley <halley@dnspython.org>2021-01-04 13:49:50 -0800
committerBob Halley <halley@dnspython.org>2021-01-04 13:49:50 -0800
commit5103169149bbf8fb1d5da803d4a408b7fefda511 (patch)
tree16c871fdb99bfc35dcf5398e505ed649bd9308da
parent14bbb9ce8865dd41465f85a1fce23989b5cb3cd0 (diff)
downloaddnspython-5103169149bbf8fb1d5da803d4a408b7fefda511.tar.gz
Cast flags and ednsflags to int when calling dns.rcode.from_flags() and
dns.opcode.from_flags(). This avoids subsequent to_text issues and other type confusion if the values were allowed to remain IntFlags.
-rw-r--r--dns/message.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/dns/message.py b/dns/message.py
index ac88837..131f1f3 100644
--- a/dns/message.py
+++ b/dns/message.py
@@ -672,7 +672,7 @@ class Message:
Returns an ``int``.
"""
- return dns.rcode.from_flags(self.flags, self.ednsflags)
+ return dns.rcode.from_flags(int(self.flags), int(self.ednsflags))
def set_rcode(self, rcode):
"""Set the rcode.
@@ -690,7 +690,7 @@ class Message:
Returns an ``int``.
"""
- return dns.opcode.from_flags(self.flags)
+ return dns.opcode.from_flags(int(self.flags))
def set_opcode(self, opcode):
"""Set the opcode.