[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Traversing - Traverser.py:1.1.2.6

Martijn Pieters mj@zope.com
Tue, 12 Feb 2002 21:20:40 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/Traversing
In directory cvs.zope.org:/tmp/cvs-serv6230/lib/python/Zope/App/Traversing

Modified Files:
      Tag: Zope-3x-branch
	Traverser.py 
Log Message:
Make sure we support not only standard Python str and unicode types, but also
subclasses. See also: 

  http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/CodeOptimization


=== Zope3/lib/python/Zope/App/Traversing/Traverser.py 1.1.2.5 => 1.1.2.6 ===
 from Zope.App.Security.SecurityManagement import getSecurityManager
 
-from types import StringType, UnicodeType
+from types import StringTypes
 
 from __future__ import generators
 
@@ -56,7 +56,7 @@
     def unrestrictedTraverse(self, path, default=_marker, restricted=0):
         if not path: return self._wrapper
 
-        if type(path) in (StringType, UnicodeType):
+        if isinstance(path, StringTypes):
             path = path.split('/')
             if len(path) > 1 and not path[-1]:
                 # Remove trailing slash