[ZPT] CVS: Zope/lib/python/Products/PageTemplates - ZopePageTemplate.py:1.34

Fred L. Drake, Jr. fdrake@acm.org
Fri, 12 Apr 2002 16:09:05 -0400


Update of /cvs-repository/Zope/lib/python/Products/PageTemplates
In directory cvs.zope.org:/tmp/cvs-serv30207

Modified Files:
	ZopePageTemplate.py 
Log Message:
Minor code cleanliness nit.

=== Zope/lib/python/Products/PageTemplates/ZopePageTemplate.py 1.33 => 1.34 ===
 
 import os, AccessControl, Acquisition, sys
+from types import StringType
 from Globals import DTMLFile, ImageFile, MessageDialog, package_home
 from zLOG import LOG, ERROR, INFO
 from OFS.SimpleItem import SimpleItem
@@ -128,8 +129,8 @@
         """Replace the document with the text in file."""
         if SUPPORTS_WEBDAV_LOCKS and self.wl_isLocked():
             raise ResourceLockedError, "File is locked via WebDAV"
-            
-        if type(file) is not type(''): 
+
+        if isinstance(file, StringType): 
             if not file: raise ValueError, 'File not specified'
             file = file.read()