Skip to content

Commit 19e64af

Browse files
gh-141070: Rename PyUnstable_Object_Dump to PyObject_Dump (GH-142848)
1 parent 780e969 commit 19e64af

File tree

11 files changed

+18
-17
lines changed

11 files changed

+18
-17
lines changed

Doc/c-api/object.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Object Protocol
8585
instead of the :func:`repr`.
8686
8787
88-
.. c:function:: void PyUnstable_Object_Dump(PyObject *op)
88+
.. c:function:: void PyObject_Dump(PyObject *op)
8989
9090
Dump an object *op* to ``stderr``. This should only be used for debugging.
9191

Doc/whatsnew/3.15.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,7 @@ New features
12611261
* Add :c:func:`PyTuple_FromArray` to create a :class:`tuple` from an array.
12621262
(Contributed by Victor Stinner in :gh:`111489`.)
12631263

1264-
* Add :c:func:`PyUnstable_Object_Dump` to dump an object to ``stderr``.
1264+
* Add :c:func:`PyObject_Dump` to dump an object to ``stderr``.
12651265
It should only be used for debugging.
12661266
(Contributed by Victor Stinner in :gh:`141070`.)
12671267

Include/cpython/object.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,10 @@ PyAPI_FUNC(PyObject *) PyType_GetDict(PyTypeObject *);
295295

296296
PyAPI_FUNC(int) PyObject_Print(PyObject *, FILE *, int);
297297
PyAPI_FUNC(void) _Py_BreakPoint(void);
298-
PyAPI_FUNC(void) PyUnstable_Object_Dump(PyObject *);
298+
PyAPI_FUNC(void) PyObject_Dump(PyObject *);
299299

300300
// Alias for backward compatibility
301-
#define _PyObject_Dump PyUnstable_Object_Dump
301+
#define _PyObject_Dump PyObject_Dump
302302

303303
Py_DEPRECATED(3.15) PyAPI_FUNC(PyObject*) _PyObject_GetAttrId(PyObject *, _Py_Identifier *);
304304

@@ -391,7 +391,7 @@ PyAPI_FUNC(PyObject *) _PyObject_FunctionStr(PyObject *);
391391
but compile away to nothing if NDEBUG is defined.
392392
393393
However, before aborting, Python will also try to call
394-
PyUnstable_Object_Dump() on the given object. This may be of use when
394+
PyObject_Dump() on the given object. This may be of use when
395395
investigating bugs in which a particular object is corrupt (e.g. buggy a
396396
tp_visit method in an extension module breaking the garbage collector), to
397397
help locate the broken objects.

Include/internal/pycore_global_objects_fini_generated.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Misc/NEWS.d/3.15.0a3.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1452,7 +1452,7 @@ sqlite when used with multiple sub interpreters.
14521452
.. nonce: mkrhjQ
14531453
.. section: C API
14541454
1455-
Add :c:func:`PyUnstable_Object_Dump` to dump an object to ``stderr``. It
1455+
Add :c:func:`!PyUnstable_Object_Dump` to dump an object to ``stderr``. It
14561456
should only be used for debugging. Patch by Victor Stinner.
14571457

14581458
..
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Renamed :c:func:`!PyUnstable_Object_Dump` to :c:func:`PyObject_Dump`.

Modules/_testcapi/object.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,12 +507,12 @@ pyobject_dump(PyObject *self, PyObject *args)
507507

508508
if (release_gil) {
509509
Py_BEGIN_ALLOW_THREADS
510-
PyUnstable_Object_Dump(op);
510+
PyObject_Dump(op);
511511
Py_END_ALLOW_THREADS
512512

513513
}
514514
else {
515-
PyUnstable_Object_Dump(op);
515+
PyObject_Dump(op);
516516
}
517517
Py_RETURN_NONE;
518518
}

Objects/object.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ _PyObject_IsFreed(PyObject *op)
713713

714714
/* For debugging convenience. See Misc/gdbinit for some useful gdb hooks */
715715
void
716-
PyUnstable_Object_Dump(PyObject* op)
716+
PyObject_Dump(PyObject* op)
717717
{
718718
if (_PyObject_IsFreed(op)) {
719719
/* It seems like the object memory has been freed:
@@ -3157,7 +3157,7 @@ _PyObject_AssertFailed(PyObject *obj, const char *expr, const char *msg,
31573157

31583158
/* This might succeed or fail, but we're about to abort, so at least
31593159
try to provide any extra info we can: */
3160-
PyUnstable_Object_Dump(obj);
3160+
PyObject_Dump(obj);
31613161

31623162
fprintf(stderr, "\n");
31633163
fflush(stderr);

Objects/unicodeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ unicode_check_encoding_errors(const char *encoding, const char *errors)
547547
}
548548

549549
/* Disable checks during Python finalization. For example, it allows to
550-
* call PyUnstable_Object_Dump() during finalization for debugging purpose.
550+
* call PyObject_Dump() during finalization for debugging purpose.
551551
*/
552552
if (_PyInterpreterState_GetFinalizing(interp) != NULL) {
553553
return 0;

Python/gc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2243,7 +2243,7 @@ _PyGC_Fini(PyInterpreterState *interp)
22432243
void
22442244
_PyGC_Dump(PyGC_Head *g)
22452245
{
2246-
PyUnstable_Object_Dump(FROM_GC(g));
2246+
PyObject_Dump(FROM_GC(g));
22472247
}
22482248

22492249

0 commit comments

Comments
 (0)