mirror of
https://github.com/python/cpython.git
synced 2025-12-11 19:40:17 +00:00
Remove proxy_print(), since that caused an inconsistency between
"print repr(proxy(a))" and "proxy(a)" at an interactive prompt. Closes SF bug #722763.
This commit is contained in:
parent
f425b1ec42
commit
fe89cc186c
1 changed files with 2 additions and 10 deletions
|
|
@ -264,14 +264,6 @@ WRAP_BINARY(proxy_getattr, PyObject_GetAttr)
|
||||||
WRAP_UNARY(proxy_str, PyObject_Str)
|
WRAP_UNARY(proxy_str, PyObject_Str)
|
||||||
WRAP_TERNARY(proxy_call, PyEval_CallObjectWithKeywords)
|
WRAP_TERNARY(proxy_call, PyEval_CallObjectWithKeywords)
|
||||||
|
|
||||||
static int
|
|
||||||
proxy_print(PyWeakReference *proxy, FILE *fp, int flags)
|
|
||||||
{
|
|
||||||
if (!proxy_checkref(proxy))
|
|
||||||
return -1;
|
|
||||||
return PyObject_Print(PyWeakref_GET_OBJECT(proxy), fp, flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
proxy_repr(PyWeakReference *proxy)
|
proxy_repr(PyWeakReference *proxy)
|
||||||
{
|
{
|
||||||
|
|
@ -479,7 +471,7 @@ _PyWeakref_ProxyType = {
|
||||||
0,
|
0,
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor)weakref_dealloc, /* tp_dealloc */
|
(destructor)weakref_dealloc, /* tp_dealloc */
|
||||||
(printfunc)proxy_print, /* tp_print */
|
0, /* tp_print */
|
||||||
0, /* tp_getattr */
|
0, /* tp_getattr */
|
||||||
0, /* tp_setattr */
|
0, /* tp_setattr */
|
||||||
proxy_compare, /* tp_compare */
|
proxy_compare, /* tp_compare */
|
||||||
|
|
@ -514,7 +506,7 @@ _PyWeakref_CallableProxyType = {
|
||||||
0,
|
0,
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor)weakref_dealloc, /* tp_dealloc */
|
(destructor)weakref_dealloc, /* tp_dealloc */
|
||||||
(printfunc)proxy_print, /* tp_print */
|
0, /* tp_print */
|
||||||
0, /* tp_getattr */
|
0, /* tp_getattr */
|
||||||
0, /* tp_setattr */
|
0, /* tp_setattr */
|
||||||
proxy_compare, /* tp_compare */
|
proxy_compare, /* tp_compare */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue