From: Bob Halley Date: Mon, 4 Jan 2021 21:49:50 +0000 (-0800) Subject: Cast flags and ednsflags to int when calling dns.rcode.from_flags() and X-Git-Tag: v2.1.0~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5103169149bbf8fb1d5da803d4a408b7fefda511;p=thirdparty%2Fdnspython.git 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. --- diff --git a/dns/message.py b/dns/message.py index ac888379..131f1f3f 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.