summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIwan Aucamp <aucampia@gmail.com>2022-07-20 15:06:32 +0200
committerGitHub <noreply@github.com>2022-07-20 15:06:32 +0200
commit92c94006dfb8a1a465326d7ec885ea41abb5732c (patch)
tree6260a2e5ff8cf6afc8f7d36e89c958686bfb10fc
parent6be93b63fd1afb0e680da32d06d7944a7843ff00 (diff)
downloadrdflib-92c94006dfb8a1a465326d7ec885ea41abb5732c.tar.gz
fix: import xml.sax.handler from the right place (#2041)
Change the import of `xml.sax.handler` in the TriX parser so that it imports from `xml.sax` and not from `xml.sax.saxutils`. Importing from `xml.sax.saxutils` causes mypy to fail but it is also wrong as there is no documented `handler` in `xml.sax.saxutils`.
-rw-r--r--CHANGELOG.md16
-rw-r--r--rdflib/plugins/parsers/trix.py3
2 files changed, 17 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 81075f56..e7a87d9f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -74,6 +74,22 @@ and will be removed for release.
<!-- -->
<!-- -->
+- Fixed import of `xml.sax.handler` in `rdflib.plugins.parsers.trix` so that it
+ no longer tries to import it from `xml.sax.saxutils`.
+ [PR #2041](https://github.com/RDFLib/rdflib/pull/2041).
+
+<!-- -->
+<!-- -->
+<!-- CHANGE BARRIER: END -->
+<!-- -->
+<!-- -->
+
+<!-- -->
+<!-- -->
+<!-- CHANGE BARRIER: START -->
+<!-- -->
+<!-- -->
+
- PLACEHOLDER.
Description of changes.
Closed [issue #....](https://github.com/RDFLib/rdflib/issues/).
diff --git a/rdflib/plugins/parsers/trix.py b/rdflib/plugins/parsers/trix.py
index 5529b0fb..76ff5745 100644
--- a/rdflib/plugins/parsers/trix.py
+++ b/rdflib/plugins/parsers/trix.py
@@ -1,9 +1,8 @@
"""
A TriX parser for RDFLib
"""
-from xml.sax import make_parser
+from xml.sax import handler, make_parser
from xml.sax.handler import ErrorHandler
-from xml.sax.saxutils import handler
from rdflib.exceptions import ParserError
from rdflib.graph import Graph