[Zope-Checkins] CVS: Zope/lib/python/AccessControl - cAccessControl.c:1.10.12.5

Shane Hathaway shane@digicool.com
Thu, 18 Oct 2001 13:40:13 -0400


Update of /cvs-repository/Zope/lib/python/AccessControl
In directory cvs.zope.org:/tmp/cvs-serv11999

Modified Files:
      Tag: cAccessControl-review-branch
	cAccessControl.c 
Log Message:
Fixed a bug caught by the PermissionRole tests.  __of__ should always
return a list or tuple, not a string.


=== Zope/lib/python/AccessControl/cAccessControl.c 1.10.12.4 => 1.10.12.5 ===
 static PyObject *_what_not_even_god_should_do = NULL;
 static PyObject *Anonymous = NULL;
+static PyObject *AnonymousTuple = NULL;
 static PyObject *imPermissionRoleObj = NULL;
 static PyObject *defaultPermission = NULL;
 static PyObject *__roles__ = NULL;
@@ -379,6 +380,7 @@
 	UNLESS (__roles__ = PyString_FromString("__roles__")) return -1;
 	UNLESS (__of__ = PyString_FromString("__of__")) return -1;
 	UNLESS (Anonymous = PyString_FromString("Anonymous")) return -1;
+	UNLESS (AnonymousTuple = Py_BuildValue("(s)", "Anonymous")) return -1;
 	UNLESS (stack_str = PyString_FromString("stack")) return -1;
 	UNLESS (user_str = PyString_FromString("user")) return -1;
 	UNLESS (_proxy_roles_str = PyString_FromString("_proxy_roles"))
@@ -1082,7 +1084,7 @@
 		if (roles != NULL) {
 
 			if (roles == Py_None) {
-				result = Anonymous;
+				result = AnonymousTuple;
 				Py_INCREF(result);
 				goto err;
 			}