summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
Diffstat (limited to 'Objects')
-rw-r--r--Objects/object.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/Objects/object.c b/Objects/object.c
index eff6d7a..8a898f8 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -231,9 +231,13 @@ PyObject_Print(PyObject *op, FILE *fp, int flags)
/* For debugging convenience. See Misc/gdbinit for some useful gdb hooks */
void _PyObject_Dump(PyObject* op)
{
- (void)PyObject_Print(op, stderr, 0);
- fprintf(stderr, "\nrefcounts: %d\n", op->ob_refcnt);
- fprintf(stderr, "address : %p\n", op);
+ if (op == NULL)
+ fprintf(stderr, "NULL\n");
+ else {
+ (void)PyObject_Print(op, stderr, 0);
+ fprintf(stderr, "\nrefcounts: %d\n", op->ob_refcnt);
+ fprintf(stderr, "address : %p\n", op);
+ }
}
#ifdef WITH_CYCLE_GC