mirror of https://github.com/python/cpython.git
Under certain conditions (sometimes triggered by the test suite),
"from xml.parsers import expat" succeeds but the imported expat module is an empty shell. Make sure we don't be fooled by that.
This commit is contained in:
parent
e37e96df06
commit
b855134a0d
|
@ -361,6 +361,8 @@ def handle_entityref(self, entity):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from xml.parsers import expat
|
from xml.parsers import expat
|
||||||
|
if not hasattr(expat, "ParserCreate"):
|
||||||
|
raise ImportError, "ParserCreate"
|
||||||
except ImportError:
|
except ImportError:
|
||||||
ExpatParser = None
|
ExpatParser = None
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue