[ZPT] CVS: Releases/Zope/lib/python/TAL - XMLParser.py:1.6

Jeremy Hylton jeremy@zope.com
Fri, 19 Oct 2001 14:08:05 -0400


Update of /cvs-repository/Releases/Zope/lib/python/TAL
In directory cvs.zope.org:/tmp/cvs-serv28794

Modified Files:
	XMLParser.py 
Log Message:
Replace writes to sys.stderr with zLOG calls.

This silences extraneous output when running the TAL tests with a
Python without expat.


=== Releases/Zope/lib/python/TAL/XMLParser.py 1.5 => 1.6 ===
 """
 
-import sys
+import zLOG
 
 class XMLParser:
 
@@ -121,7 +121,8 @@
             try:
                 self.parser.ordered_attributes = self.ordered_attributes
             except AttributeError:
-                sys.stderr.write("Can't set ordered_attributes\n")
+                zLOG.LOG("TAL.XMLParser", zLOG.INFO, 
+                         "Can't set ordered_attributes")
                 self.ordered_attributes = 0
         for name in self.handler_names:
             method = getattr(self, name, None)
@@ -129,7 +130,8 @@
                 try:
                     setattr(p, name, method)
                 except AttributeError:
-                    sys.stderr.write("Can't set expat handler %s\n" % name)
+                    zLOG.LOG("TAL.XMLParser", zLOG.PROBLEM,
+                             "Can't set expat handler %s" % name)
 
     def createParser(self, encoding=None):
         global XMLParseError