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

Chris Withers chrisw@nipltd.com
Thu, 8 Aug 2002 05:04:55 -0400


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

Modified Files:
	test.py 
Log Message:
Attempt to get tests to run on a debian box with a python 2.2 source install and PyXML 0.8.

=== Zope3/test.py 1.10 => 1.11 ===
--- Zope3/test.py:1.10	Wed Jul 17 19:09:43 2002
+++ Zope3/test.py	Thu Aug  8 05:04:55 2002
@@ -108,8 +108,18 @@
 try:
     import pyexpat
 except ImportError:
-    print >> sys.stderr, "WARNING: the pyexpat module is required"
-    raise
+    
+    # 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
 
 class ImmediateTestResult(unittest._TextTestResult):