summaryrefslogtreecommitdiffstats
path: root/Modules/_tkinter.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-09-23 19:49:02 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-09-23 19:49:02 (GMT)
commit463bd4b5c6046f2501b36978ea2732e5bcd4ea19 (patch)
tree343e79bc7e18f66f48356b5bf437ef12f90f6ad2 /Modules/_tkinter.c
parent64a9972b40b8258a6e37498da6279f4e40a88e2d (diff)
downloadcpython-463bd4b5c6046f2501b36978ea2732e5bcd4ea19.zip
cpython-463bd4b5c6046f2501b36978ea2732e5bcd4ea19.tar.gz
cpython-463bd4b5c6046f2501b36978ea2732e5bcd4ea19.tar.bz2
Issue #19034: repr() for tkinter.Tcl_Obj now exposes string reperesentation.
Diffstat (limited to 'Modules/_tkinter.c')
-rw-r--r--Modules/_tkinter.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index 7b58fd8..e022a7a 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -737,8 +737,13 @@ PyTclObject_str(PyTclObject *self, void *ignored)
static PyObject *
PyTclObject_repr(PyTclObject *self)
{
- return PyUnicode_FromFormat("<%s object at %p>",
- self->value->typePtr->name, self->value);
+ PyObject *repr, *str = PyTclObject_str(self, NULL);
+ if (str == NULL)
+ return NULL;
+ repr = PyUnicode_FromFormat("<%s object: %R>",
+ self->value->typePtr->name, str);
+ Py_DECREF(str);
+ return repr;
}
#define TEST_COND(cond) ((cond) ? Py_True : Py_False)