From: Guido van Rossum Date: Tue, 2 Oct 2001 18:33:11 +0000 (+0000) Subject: Under certain conditions (sometimes triggered by the test suite), X-Git-Tag: v2.2.1c1~1498 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b855134a0d9f8e505c51ade315912cf030e46ccc;p=python 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. --- diff --git a/Lib/xmlrpclib.py b/Lib/xmlrpclib.py index 3524a45bda..4e98c4c802 100644 --- a/Lib/xmlrpclib.py +++ b/Lib/xmlrpclib.py @@ -361,6 +361,8 @@ else: try: from xml.parsers import expat + if not hasattr(expat, "ParserCreate"): + raise ImportError, "ParserCreate" except ImportError: ExpatParser = None else: