summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2000-07-12 05:18:36 (GMT)
committerBarry Warsaw <barry@python.org>2000-07-12 05:18:36 (GMT)
commit35e459c3eb60634f7edfa77824a468b52a479dc7 (patch)
treef0ff805afd9a7dc26ba4a34299b9aad3876dd17c /Modules
parenta618028e45c7a4eb9445501e3f104bf18e9a1be3 (diff)
downloadcpython-35e459c3eb60634f7edfa77824a468b52a479dc7.zip
cpython-35e459c3eb60634f7edfa77824a468b52a479dc7.tar.gz
cpython-35e459c3eb60634f7edfa77824a468b52a479dc7.tar.bz2
debug_instance(): Use the same %p format directive as with
debug_cycle(), and don't cast the pointer to a long. Neither needs the literal `0x' prefix as %p automatically inserts this (on Linux at least).
Diffstat (limited to 'Modules')
-rw-r--r--Modules/gcmodule.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c
index 4d55a08..60b4fe7 100644
--- a/Modules/gcmodule.c
+++ b/Modules/gcmodule.c
@@ -277,8 +277,7 @@ debug_instance(PyObject *output, char *msg, PyInstanceObject *inst)
cname = PyString_AsString(classname);
else
cname = "?";
- sprintf(buf, "gc: %s<%.100s instance at %lx>\n",
- msg, cname, (long)inst);
+ sprintf(buf, "gc: %s<%.100s instance at %p>\n", msg, cname, inst);
PyFile_WriteString(buf, output);
}
@@ -289,10 +288,8 @@ debug_cycle(PyObject *output, char *msg, PyObject *op)
debug_instance(output, msg, (PyInstanceObject *)op);
} else if (debug & DEBUG_OBJECTS) {
char buf[200];
- sprintf(buf, "gc: %s<%.100s 0x%p>\n",
- msg,
- op->ob_type->tp_name,
- op);
+ sprintf(buf, "gc: %s<%.100s %p>\n", msg,
+ op->ob_type->tp_name, op);
PyFile_WriteString(buf, output);
}
}