[Zope3-checkins] SVN: Zope3/branches/ZopeX3-3.0/ Merged changes from trunk revision 26898

Dmitry Vasiliev dima at hlabs.spb.ru
Wed Aug 4 06:03:17 EDT 2004


Log message for revision 26899:
  Merged changes from trunk revision 26898
  


Changed:
  U   Zope3/branches/ZopeX3-3.0/doc/CHANGES.txt
  U   Zope3/branches/ZopeX3-3.0/src/zope/interface/_zope_interface_coptimizations.c
  UU  Zope3/branches/ZopeX3-3.0/src/zope/interface/tests/test_interface.py
  _U  Zope3/branches/ZopeX3-3.0/src/zope/interface/tests/unitfixtures.py


-=-
Modified: Zope3/branches/ZopeX3-3.0/doc/CHANGES.txt
===================================================================
--- Zope3/branches/ZopeX3-3.0/doc/CHANGES.txt	2004-08-04 09:38:12 UTC (rev 26898)
+++ Zope3/branches/ZopeX3-3.0/doc/CHANGES.txt	2004-08-04 10:03:17 UTC (rev 26899)
@@ -12,6 +12,8 @@
 
     Bug fixes
 
+      - Fixed issue 228.
+
       - A service registration form now displays correct information
         about the registration.
 

Modified: Zope3/branches/ZopeX3-3.0/src/zope/interface/_zope_interface_coptimizations.c
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/interface/_zope_interface_coptimizations.c	2004-08-04 09:38:12 UTC (rev 26898)
+++ Zope3/branches/ZopeX3-3.0/src/zope/interface/_zope_interface_coptimizations.c	2004-08-04 10:03:17 UTC (rev 26899)
@@ -178,7 +178,7 @@
       return getObjectSpecification(NULL, ob);
     } 
 
-  
+
   /* We want to make sure we have a spec. We can't do a type check
      because we may have a proxy, so we'll just try to get the
      only attribute.
@@ -256,7 +256,7 @@
 
   implied = inst_attr(self, str_implied);
   if (implied == NULL)
-    return implied;
+    return NULL;
 
 #ifdef Py_True
   if (PyDict_GetItem(implied, other) != NULL)
@@ -285,7 +285,9 @@
   PyObject *decl, *item;
 
   decl = providedBy(NULL, ob);
-  
+  if (decl == NULL)
+    return NULL;
+
   if (PyObject_TypeCheck(ob, &SpecType))
     item = Spec_extends(decl, self);
   else

Modified: Zope3/branches/ZopeX3-3.0/src/zope/interface/tests/test_interface.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/interface/tests/test_interface.py	2004-08-04 09:38:12 UTC (rev 26898)
+++ Zope3/branches/ZopeX3-3.0/src/zope/interface/tests/test_interface.py	2004-08-04 10:03:17 UTC (rev 26899)
@@ -21,12 +21,6 @@
 
 class InterfaceTests(unittest.TestCase):
 
-    def setUp(self):
-        pass
-
-    def tearDown(self):
-        pass
-
     def testClassImplements(self):
         self.assert_(IC.implementedBy(C))
 
@@ -248,6 +242,14 @@
         self.assertEqual(I.__doc__, "")
         self.assertEqual(list(I), ['__doc__'])
 
+    def testIssue228(self):
+        # Test for http://collector.zope.org/Zope3-dev/228
+        class I(Interface):
+            "xxx"
+        class Bad:
+            __providedBy__ = None
+        # Old style classes don't have a '__class__' attribute
+        self.failUnlessRaises(AttributeError, I.providedBy, Bad)
 
 
 class _I1(Interface):


Property changes on: Zope3/branches/ZopeX3-3.0/src/zope/interface/tests/test_interface.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: Zope3/branches/ZopeX3-3.0/src/zope/interface/tests/unitfixtures.py
___________________________________________________________________
Name: svn:keywords
   + Id



More information about the Zope3-Checkins mailing list