[Zope3-checkins] SVN: Zope3/trunk/src/zope/security/_zope_security_checker.c Added a chack that raises an error of __Security_checker__ is None.

Jim Fulton jim at zope.com
Tue Jul 6 15:12:57 EDT 2004


Log message for revision 26130:
Added a chack that raises an error of __Security_checker__ is None.



-=-
Modified: Zope3/trunk/src/zope/security/_zope_security_checker.c
===================================================================
--- Zope3/trunk/src/zope/security/_zope_security_checker.c	2004-07-06 19:12:08 UTC (rev 26129)
+++ Zope3/trunk/src/zope/security/_zope_security_checker.c	2004-07-06 19:12:57 UTC (rev 26130)
@@ -260,6 +260,20 @@
           return value;
         }
     }
+  else if (checker == Py_None)
+    {
+      PyObject *errv = Py_BuildValue("sO",
+                                     "Invalid value, None. "
+                                     "for security checker",
+                                     value);
+      if (errv != NULL)
+        {
+          PyErr_SetObject(PyExc_ValueError, errv);
+          Py_DECREF(errv);
+        }
+      
+      return NULL;
+    }
     
   r = PyObject_CallFunctionObjArgs(Proxy, value, checker, NULL);
   Py_DECREF(checker);



More information about the Zope3-Checkins mailing list