[Zope-CVS] CVS: Zope3 - test.py:1.12

Fred L. Drake, Jr. fdrake@acm.org
Thu, 8 Aug 2002 10:15:28 -0400


Update of /cvs-repository/Zope3
In directory cvs.zope.org:/tmp/cvs-serv20530

Modified Files:
	test.py 
Log Message:
Clean up the check for pyexpat.


=== Zope3/test.py 1.11 => 1.12 ===
--- Zope3/test.py:1.11	Thu Aug  8 05:04:55 2002
+++ Zope3/test.py	Thu Aug  8 10:15:28 2002
@@ -106,20 +106,10 @@
 # We know we're going to need this so import it now.  Python 2.2 does not come
 # with the pyexpat library by default, although Python 2.3 will.
 try:
-    import pyexpat
+    import xml.parsers.expat
 except ImportError:
-    
-    # lets try Kapil's nasty hack to see if we can get further
-    # this isn't nice, surely there must be a better way?!
-    from xml.parsers import expat as pyexpat
-    sys.modules['pyexpat']=pyexpat
-    
-    # now lets try again...
-    try:        
-        import pyexpat
-    except:
-        print >> sys.stderr, "WARNING: the pyexpat module is required"
-        raise
+    print >> sys.stderr, "WARNING: the pyexpat module is required"
+    raise
 
 class ImmediateTestResult(unittest._TextTestResult):