From: Bob Halley Date: Thu, 14 Oct 2021 16:37:54 +0000 (-0700) Subject: _cmp() raised NoRelativeRdataOrdering in abs vs. abs case X-Git-Tag: v2.2.0rc1~49^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F703%2Fhead;p=thirdparty%2Fdnspython.git _cmp() raised NoRelativeRdataOrdering in abs vs. abs case --- diff --git a/dns/rdata.py b/dns/rdata.py index 1917ecd4..624063e0 100644 --- a/dns/rdata.py +++ b/dns/rdata.py @@ -264,13 +264,15 @@ class Rdata: our = self.to_digestable() our_relative = False except dns.name.NeedAbsoluteNameOrOrigin: - our = self.to_digestable(dns.name.root) + if _allow_relative_comparisons: + our = self.to_digestable(dns.name.root) our_relative = True try: their = other.to_digestable() their_relative = False except dns.name.NeedAbsoluteNameOrOrigin: - their = other.to_digestable(dns.name.root) + if _allow_relative_comparisons: + their = other.to_digestable(dns.name.root) their_relative = True if _allow_relative_comparisons: if our_relative != their_relative: @@ -280,7 +282,7 @@ class Rdata: return -1 else: return 1 - else: + elif our_relative or their_relative: raise NoRelativeRdataOrdering if our == their: return 0