Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix logic in using non-ill-typed XML literals for comparison
Browse files Browse the repository at this point in the history
ashleysommer committed Oct 24, 2024

Verified

This commit was signed with the committer’s verified signature.
doppins-bot Doppins
1 parent 5214ba2 commit 191dce3
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions rdflib/term.py
Original file line number Diff line number Diff line change
@@ -1388,8 +1388,8 @@ def eq(self, other: Any) -> bool:

# XML can be compared to HTML, only if html5rdf is enabled
if ((dtself in _XML_COMPARABLE and dtother in _XML_COMPARABLE) and
# Ill-typed can be none if unknown, but we don't want it to be False.
((self.ill_typed is not False) and (other.ill_typed is not False)) and
# Ill-typed can be None if unknown, but we don't want it to be True.
((self.ill_typed is not True) and (other.ill_typed is not True)) and
(self.value is not None and other.value is not None)):
return _isEqualXMLNode(self.value, other.value)

4 changes: 2 additions & 2 deletions test/test_literal/test_xmlliterals.py
Original file line number Diff line number Diff line change
@@ -126,7 +126,7 @@ def testHTML(): # noqa: N802
textwrap.dedent(
"""\
<!DOCTYPE example>
<something/>
<something2/>
"""
)
),
@@ -137,7 +137,7 @@ def testHTML(): # noqa: N802
textwrap.dedent(
"""\
<!DOCTYPE example>
<something />
<something2 />
"""
)
),

0 comments on commit 191dce3

Please sign in to comment.