mirror of
https://github.com/python/cpython.git
synced 2025-08-24 02:35:59 +00:00
Recorded merge of revisions 81029 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........
This commit is contained in:
parent
ba32864b2d
commit
c7c96a90bc
321 changed files with 195492 additions and 195492 deletions
|
@ -57,9 +57,9 @@ clear_weakref(PyWeakReference *self)
|
|||
PyWeakref_GET_OBJECT(self));
|
||||
|
||||
if (*list == self)
|
||||
/* If 'self' is the end of the list (and thus self->wr_next == NULL)
|
||||
then the weakref list itself (and thus the value of *list) will
|
||||
end up being set to NULL. */
|
||||
/* If 'self' is the end of the list (and thus self->wr_next == NULL)
|
||||
then the weakref list itself (and thus the value of *list) will
|
||||
end up being set to NULL. */
|
||||
*list = self->wr_next;
|
||||
self->wr_object = Py_None;
|
||||
if (self->wr_prev != NULL)
|
||||
|
@ -161,21 +161,21 @@ weakref_repr(PyWeakReference *self)
|
|||
PyOS_snprintf(buffer, sizeof(buffer), "<weakref at %p; dead>", self);
|
||||
}
|
||||
else {
|
||||
char *name = NULL;
|
||||
PyObject *nameobj = PyObject_GetAttrString(PyWeakref_GET_OBJECT(self),
|
||||
"__name__");
|
||||
if (nameobj == NULL)
|
||||
PyErr_Clear();
|
||||
else if (PyString_Check(nameobj))
|
||||
name = PyString_AS_STRING(nameobj);
|
||||
char *name = NULL;
|
||||
PyObject *nameobj = PyObject_GetAttrString(PyWeakref_GET_OBJECT(self),
|
||||
"__name__");
|
||||
if (nameobj == NULL)
|
||||
PyErr_Clear();
|
||||
else if (PyString_Check(nameobj))
|
||||
name = PyString_AS_STRING(nameobj);
|
||||
PyOS_snprintf(buffer, sizeof(buffer),
|
||||
name ? "<weakref at %p; to '%.50s' at %p (%s)>"
|
||||
: "<weakref at %p; to '%.50s' at %p>",
|
||||
self,
|
||||
Py_TYPE(PyWeakref_GET_OBJECT(self))->tp_name,
|
||||
PyWeakref_GET_OBJECT(self),
|
||||
name);
|
||||
Py_XDECREF(nameobj);
|
||||
name ? "<weakref at %p; to '%.50s' at %p (%s)>"
|
||||
: "<weakref at %p; to '%.50s' at %p>",
|
||||
self,
|
||||
Py_TYPE(PyWeakref_GET_OBJECT(self))->tp_name,
|
||||
PyWeakref_GET_OBJECT(self),
|
||||
name);
|
||||
Py_XDECREF(nameobj);
|
||||
}
|
||||
return PyString_FromString(buffer);
|
||||
}
|
||||
|
@ -337,10 +337,10 @@ _PyWeakref_RefType = {
|
|||
sizeof(PyWeakReference),
|
||||
0,
|
||||
weakref_dealloc, /*tp_dealloc*/
|
||||
0, /*tp_print*/
|
||||
0, /*tp_print*/
|
||||
0, /*tp_getattr*/
|
||||
0, /*tp_setattr*/
|
||||
0, /*tp_compare*/
|
||||
0, /*tp_compare*/
|
||||
(reprfunc)weakref_repr, /*tp_repr*/
|
||||
0, /*tp_as_number*/
|
||||
0, /*tp_as_sequence*/
|
||||
|
@ -356,7 +356,7 @@ _PyWeakref_RefType = {
|
|||
0, /*tp_doc*/
|
||||
(traverseproc)gc_traverse, /*tp_traverse*/
|
||||
(inquiry)gc_clear, /*tp_clear*/
|
||||
(richcmpfunc)weakref_richcompare, /*tp_richcompare*/
|
||||
(richcmpfunc)weakref_richcompare, /*tp_richcompare*/
|
||||
0, /*tp_weaklistoffset*/
|
||||
0, /*tp_iter*/
|
||||
0, /*tp_iternext*/
|
||||
|
@ -436,9 +436,9 @@ proxy_checkref(PyWeakReference *proxy)
|
|||
#define WRAP_METHOD(method, special) \
|
||||
static PyObject * \
|
||||
method(PyObject *proxy) { \
|
||||
UNWRAP(proxy); \
|
||||
return PyObject_CallMethod(proxy, special, ""); \
|
||||
}
|
||||
UNWRAP(proxy); \
|
||||
return PyObject_CallMethod(proxy, special, ""); \
|
||||
}
|
||||
|
||||
|
||||
/* direct slots */
|
||||
|
@ -452,9 +452,9 @@ proxy_repr(PyWeakReference *proxy)
|
|||
{
|
||||
char buf[160];
|
||||
PyOS_snprintf(buf, sizeof(buf),
|
||||
"<weakproxy at %p to %.100s at %p>", proxy,
|
||||
Py_TYPE(PyWeakref_GET_OBJECT(proxy))->tp_name,
|
||||
PyWeakref_GET_OBJECT(proxy));
|
||||
"<weakproxy at %p to %.100s at %p>", proxy,
|
||||
Py_TYPE(PyWeakref_GET_OBJECT(proxy))->tp_name,
|
||||
PyWeakref_GET_OBJECT(proxy));
|
||||
return PyString_FromString(buf);
|
||||
}
|
||||
|
||||
|
@ -604,8 +604,8 @@ WRAP_METHOD(proxy_unicode, "__unicode__");
|
|||
|
||||
|
||||
static PyMethodDef proxy_methods[] = {
|
||||
{"__unicode__", (PyCFunction)proxy_unicode, METH_NOARGS},
|
||||
{NULL, NULL}
|
||||
{"__unicode__", (PyCFunction)proxy_unicode, METH_NOARGS},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
|
||||
|
@ -677,20 +677,20 @@ _PyWeakref_ProxyType = {
|
|||
0,
|
||||
/* methods */
|
||||
(destructor)proxy_dealloc, /* tp_dealloc */
|
||||
0, /* tp_print */
|
||||
0, /* tp_getattr */
|
||||
0, /* tp_setattr */
|
||||
proxy_compare, /* tp_compare */
|
||||
(reprfunc)proxy_repr, /* tp_repr */
|
||||
&proxy_as_number, /* tp_as_number */
|
||||
&proxy_as_sequence, /* tp_as_sequence */
|
||||
&proxy_as_mapping, /* tp_as_mapping */
|
||||
0, /* tp_hash */
|
||||
0, /* tp_call */
|
||||
0, /* tp_print */
|
||||
0, /* tp_getattr */
|
||||
0, /* tp_setattr */
|
||||
proxy_compare, /* tp_compare */
|
||||
(reprfunc)proxy_repr, /* tp_repr */
|
||||
&proxy_as_number, /* tp_as_number */
|
||||
&proxy_as_sequence, /* tp_as_sequence */
|
||||
&proxy_as_mapping, /* tp_as_mapping */
|
||||
0, /* tp_hash */
|
||||
0, /* tp_call */
|
||||
proxy_str, /* tp_str */
|
||||
proxy_getattr, /* tp_getattro */
|
||||
(setattrofunc)proxy_setattr, /* tp_setattro */
|
||||
0, /* tp_as_buffer */
|
||||
0, /* tp_as_buffer */
|
||||
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC
|
||||
| Py_TPFLAGS_CHECKTYPES, /* tp_flags */
|
||||
0, /* tp_doc */
|
||||
|
@ -700,7 +700,7 @@ _PyWeakref_ProxyType = {
|
|||
0, /* tp_weaklistoffset */
|
||||
(getiterfunc)proxy_iter, /* tp_iter */
|
||||
(iternextfunc)proxy_iternext, /* tp_iternext */
|
||||
proxy_methods, /* tp_methods */
|
||||
proxy_methods, /* tp_methods */
|
||||
};
|
||||
|
||||
|
||||
|
@ -712,20 +712,20 @@ _PyWeakref_CallableProxyType = {
|
|||
0,
|
||||
/* methods */
|
||||
(destructor)proxy_dealloc, /* tp_dealloc */
|
||||
0, /* tp_print */
|
||||
0, /* tp_getattr */
|
||||
0, /* tp_setattr */
|
||||
proxy_compare, /* tp_compare */
|
||||
(unaryfunc)proxy_repr, /* tp_repr */
|
||||
&proxy_as_number, /* tp_as_number */
|
||||
&proxy_as_sequence, /* tp_as_sequence */
|
||||
&proxy_as_mapping, /* tp_as_mapping */
|
||||
0, /* tp_hash */
|
||||
proxy_call, /* tp_call */
|
||||
proxy_str, /* tp_str */
|
||||
0, /* tp_print */
|
||||
0, /* tp_getattr */
|
||||
0, /* tp_setattr */
|
||||
proxy_compare, /* tp_compare */
|
||||
(unaryfunc)proxy_repr, /* tp_repr */
|
||||
&proxy_as_number, /* tp_as_number */
|
||||
&proxy_as_sequence, /* tp_as_sequence */
|
||||
&proxy_as_mapping, /* tp_as_mapping */
|
||||
0, /* tp_hash */
|
||||
proxy_call, /* tp_call */
|
||||
proxy_str, /* tp_str */
|
||||
proxy_getattr, /* tp_getattro */
|
||||
(setattrofunc)proxy_setattr, /* tp_setattro */
|
||||
0, /* tp_as_buffer */
|
||||
0, /* tp_as_buffer */
|
||||
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC
|
||||
| Py_TPFLAGS_CHECKTYPES, /* tp_flags */
|
||||
0, /* tp_doc */
|
||||
|
@ -748,7 +748,7 @@ PyWeakref_NewRef(PyObject *ob, PyObject *callback)
|
|||
|
||||
if (!PyType_SUPPORTS_WEAKREFS(Py_TYPE(ob))) {
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"cannot create weak reference to '%s' object",
|
||||
"cannot create weak reference to '%s' object",
|
||||
Py_TYPE(ob)->tp_name);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -807,7 +807,7 @@ PyWeakref_NewProxy(PyObject *ob, PyObject *callback)
|
|||
|
||||
if (!PyType_SUPPORTS_WEAKREFS(Py_TYPE(ob))) {
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"cannot create weak reference to '%s' object",
|
||||
"cannot create weak reference to '%s' object",
|
||||
Py_TYPE(ob)->tp_name);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -932,7 +932,7 @@ PyObject_ClearWeakRefs(PyObject *object)
|
|||
else {
|
||||
PyObject *tuple;
|
||||
Py_ssize_t i = 0;
|
||||
|
||||
|
||||
tuple = PyTuple_New(count * 2);
|
||||
if (tuple == NULL) {
|
||||
if (restore_error)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue