[CMF-checkins] CVS: CMF/CMFCore - TypesTool.py:1.46

Shane Hathaway shane@cvs.zope.org
Mon, 5 Aug 2002 17:20:05 -0400


Update of /cvs-repository/CMF/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv17088

Modified Files:
	TypesTool.py 
Log Message:
_getPortalTypeName() returns None for objects that are in the middle of being created.  TypesTool needs to account for this.  Python 2.2 revealed the attempt to getattr(self, None).

=== CMF/CMFCore/TypesTool.py 1.45 => 1.46 ===
         if type( contentType ) is not type( '' ):
             if hasattr(aq_base(contentType), '_getPortalTypeName'):
                 contentType = contentType._getPortalTypeName()
+                if contentType is None:
+                    return None
             else:
                 return None
         ob = getattr( self, contentType, None )