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:
Guido van Rossum 2001-10-02 18:33:11 +00:00
parent e37e96df06
commit b855134a0d
1 changed files with 2 additions and 0 deletions

View File

@ -361,6 +361,8 @@ else:
try:
from xml.parsers import expat
if not hasattr(expat, "ParserCreate"):
raise ImportError, "ParserCreate"
except ImportError:
ExpatParser = None
else: