[Zope3-checkins] SVN: Zope3/branches/ZopeX3-3.0/src/zope/ Merged from trunk:

Jim Fulton jim at zope.com
Tue Aug 31 18:44:34 EDT 2004


Log message for revision 27369:
  Merged from trunk:
  
  revision 27368:
    Fixed collector issue 266
    
    http://collector.zope.org/Zope3-dev/266
  
  


Changed:
  A   Zope3/branches/ZopeX3-3.0/src/zope/app/zptpage/browser/collector266.txt
  U   Zope3/branches/ZopeX3-3.0/src/zope/app/zptpage/browser/ftests.py
  U   Zope3/branches/ZopeX3-3.0/src/zope/tal/taldefs.py


-=-
Copied: Zope3/branches/ZopeX3-3.0/src/zope/app/zptpage/browser/collector266.txt (from rev 27368, Zope3/trunk/src/zope/app/zptpage/browser/collector266.txt)


Property changes on: Zope3/branches/ZopeX3-3.0/src/zope/app/zptpage/browser/collector266.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/zptpage/browser/ftests.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/zptpage/browser/ftests.py	2004-08-31 22:16:42 UTC (rev 27368)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/zptpage/browser/ftests.py	2004-08-31 22:44:34 UTC (rev 27369)
@@ -175,8 +175,10 @@
 
 
 def test_suite():
+    from zope.app.tests.functional import FunctionalDocFileSuite
     return unittest.TestSuite((
         unittest.makeSuite(ZPTPageTest),
+        FunctionalDocFileSuite('collector266.txt'),
         ))
 
 if __name__ == '__main__':

Modified: Zope3/branches/ZopeX3-3.0/src/zope/tal/taldefs.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/tal/taldefs.py	2004-08-31 22:16:42 UTC (rev 27368)
+++ Zope3/branches/ZopeX3-3.0/src/zope/tal/taldefs.py	2004-08-31 22:44:34 UTC (rev 27369)
@@ -148,9 +148,17 @@
     version = getProgramVersion(program)
     return version == TAL_VERSION
 
+def isinstance_(ob, type):
+    # Proxy-friendly and faster isinstance_ check for new-style objects
+    try:
+        return type in ob.__class__.__mro__
+    except AttributeError:
+        return False
+            
+
 def getProgramMode(program):
     version = getProgramVersion(program)
-    if (version == TAL_VERSION and isinstance(program[1], tuple) and
+    if (version == TAL_VERSION and isinstance_(program[1], tuple) and
         len(program[1]) == 2):
         opcode, mode = program[1]
         if opcode == "mode":
@@ -159,7 +167,7 @@
 
 def getProgramVersion(program):
     if (len(program) >= 2 and
-        isinstance(program[0], tuple) and len(program[0]) == 2):
+        isinstance_(program[0], tuple) and len(program[0]) == 2):
         opcode, version = program[0]
         if opcode == "version":
             return version



More information about the Zope3-Checkins mailing list