diff --git a/Lib/xml/sax/expatreader.py b/Lib/xml/sax/expatreader.py index b8a31ffffa8..7c2bb899c49 100644 --- a/Lib/xml/sax/expatreader.py +++ b/Lib/xml/sax/expatreader.py @@ -17,6 +17,9 @@ try: from xml.parsers import expat except ImportError: raise SAXReaderNotAvailable("expat not supported",None) +else: + if not hasattr(expat, "ParserCreate"): + raise SAXReaderNotAvailable("expat not supported",None) from xml.sax import xmlreader, saxutils, handler AttributesImpl = xmlreader.AttributesImpl