[Zope-Checkins] CVS: Zope3 - test.py:1.1.2.10

Barry Warsaw barry@wooz.org
Fri, 31 May 2002 19:19:36 -0400


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

Modified Files:
      Tag: Zope-3x-branch
	test.py 
Log Message:
Might as well crap out early if there's no pyexpat module in your
Python.  I believe that Python 2.2 does /not/ come with pyexpat by
default but that Python 2.3 does.


=== Zope3/test.py 1.1.2.9 => 1.1.2.10 ===
 from distutils.util import get_platform
 
+# 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
+except ImportError:
+    print >> sys.stderr, "WARNING: the pyexpat module is required"
+    raise
+
 class ImmediateTestResult(unittest._TextTestResult):
 
     def _print_traceback(self, msg, err, test, errlist):