[Zope-Checkins] CVS: Products/ZopeTutorial -
TutorialTopic.py:1.14.38.4.28.1
Tres Seaver
tseaver at palladion.com
Sat May 28 20:42:15 EDT 2005
Update of /cvs-repository/Products/ZopeTutorial
In directory cvs.zope.org:/tmp/cvs-serv32028/lib/python/Products/ZopeTutorial
Modified Files:
Tag: tseaver-hasattr_geddon-branch
TutorialTopic.py
Log Message:
- Removed all uses of the 'hasattr' builtin from the core, where
the object being tested derives (or might) from Persistent.
XXX: currently, this branch imports a 'safe_hasattr' from ZODB.utils,
which adds a dependency on ZODB for some packages; we probably
need a better location, and perhas a C implementation?
=== Products/ZopeTutorial/TutorialTopic.py 1.14.38.4 => 1.14.38.4.28.1 ===
--- Products/ZopeTutorial/TutorialTopic.py:1.14.38.4 Thu Jan 8 18:33:55 2004
+++ Products/ZopeTutorial/TutorialTopic.py Sat May 28 20:41:35 2005
@@ -13,6 +13,7 @@
import OFS.Folder
from HelpSys.HelpTopic import TextTopic
from Globals import HTML, DTMLFile, MessageDialog
+from ZODB.utils import safe_hasattr
from cgi import escape
import DateTime
import DocumentTemplate
@@ -189,7 +190,7 @@
# Run lesson setup methods -- call Setup.setup methods in lesson folders
examples=folder.examples
for lesson in examples.objectValues():
- if hasattr(lesson, 'Setup'):
+ if safe_hasattr(lesson, 'Setup'):
lesson.Setup.setup(lesson.Setup, REQUEST)
if RESPONSE is not None:
More information about the Zope-Checkins
mailing list