]> granicus.if.org Git - python/commitdiff
Under certain conditions (sometimes triggered by the test suite),
authorGuido van Rossum <guido@python.org>
Tue, 2 Oct 2001 18:33:11 +0000 (18:33 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 2 Oct 2001 18:33:11 +0000 (18:33 +0000)
"from xml.parsers import expat" succeeds but the imported expat module
is an empty shell.  Make sure we don't be fooled by that.

Lib/xmlrpclib.py

index 3524a45bdaa77cf43164f4a9714a61248c3cffcb..4e98c4c8026f62a217a91dd036d0cd0d568ae933 100644 (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: