[Zope-Checkins] CVS: Zope3/lib/python/Zope/Security - _Proxy.c:1.1.4.4
Guido van Rossum
guido@python.org
Tue, 21 May 2002 08:37:38 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/Security
In directory cvs.zope.org:/tmp/cvs-serv10160
Modified Files:
Tag: Zope-3x-branch
_Proxy.c
Log Message:
Whitespace normalization.
=== Zope3/lib/python/Zope/Security/_Proxy.c 1.1.4.3 => 1.1.4.4 ===
default_repr(PyObject *object)
{
- PyObject *klass, *name=0, *module=0, *result=0;
- char *sname, *smodule;
+ PyObject *klass, *name = 0, *module = 0, *result = 0;
+ char *sname, *smodule;
- klass = PyObject_GetAttr(object, __class__str);
- if (! klass)
- return NULL;
-
- name = PyObject_GetAttr(klass, __name__str);
- if (! name)
- goto err;
- sname = PyString_AsString(name);
- if (! sname)
- goto err;
-
- module = PyObject_GetAttr(klass, __module__str);
- if (module) {
- smodule = PyString_AsString(module);
- if (! smodule)
- goto err;
- result = PyString_FromFormat("<security proxied %s.%s instance at %p>",
- smodule, sname, object);
- }
- else {
- PyErr_Clear();
- result = PyString_FromFormat("<security proxied %s instance at %p>",
- sname, object);
- }
-
- err:
-
- Py_DECREF(klass);
- Py_XDECREF(name);
- Py_XDECREF(module);
+ klass = PyObject_GetAttr(object, __class__str);
+ if (klass == NULL)
+ return NULL;
+
+ name = PyObject_GetAttr(klass, __name__str);
+ if (name == NULL)
+ goto err;
+ sname = PyString_AsString(name);
+ if (sname == NULL)
+ goto err;
+
+ module = PyObject_GetAttr(klass, __module__str);
+ if (module != NULL) {
+ smodule = PyString_AsString(module);
+ if (smodule == NULL)
+ goto err;
+ result = PyString_FromFormat(
+ "<security proxied %s.%s instance at %p>",
+ smodule, sname, object);
+ }
+ else {
+ PyErr_Clear();
+ result = PyString_FromFormat(
+ "<security proxied %s instance at %p>",
+ sname, object);
+ }
+
+ err:
+ Py_DECREF(klass);
+ Py_XDECREF(name);
+ Py_XDECREF(module);
- return result;
+ return result;
}
static PyObject *
@@ -319,10 +320,10 @@
if (check(checker, "__str__", object)) {
result = PyObject_Str(object);
}
- else {
- PyErr_Clear();
- result = default_repr(object);
- }
+ else {
+ PyErr_Clear();
+ result = default_repr(object);
+ }
return result;
}
@@ -336,10 +337,10 @@
if (check(checker, "__repr__", object)) {
result = PyObject_Repr(object);
}
- else {
- PyErr_Clear();
- result = default_repr(object);
- }
+ else {
+ PyErr_Clear();
+ result = default_repr(object);
+ }
return result;
}
@@ -879,14 +880,14 @@
{
PyObject *m;
- __class__str = PyString_FromString("__class__");
- if (! __class__str) return;
+ __class__str = PyString_FromString("__class__");
+ if (! __class__str) return;
- __name__str = PyString_FromString("__name__");
- if (! __name__str) return;
+ __name__str = PyString_FromString("__name__");
+ if (! __name__str) return;
- __module__str = PyString_FromString("__module__");
- if (! __module__str) return;
+ __module__str = PyString_FromString("__module__");
+ if (! __module__str) return;
ProxyType.ob_type = &PyType_Type;
if (PyType_Ready(&ProxyType) < 0)