Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c47bd4a

Browse files
committed
Issue #9294: remove dead code in Objects/object.c. Patch by Grant Limberg.
1 parent 63c4640 commit c47bd4a

2 files changed

Lines changed: 3 additions & 13 deletions

File tree

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,7 @@ Robert van Liere
479479
Ross Light
480480
Shawn Ligocki
481481
Martin Ligr
482+
Grant Limberg
482483
Christopher Lindblad
483484
Bjorn Lindqvist
484485
Per Lindqvist

Objects/object.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -258,15 +258,10 @@ _PyObject_NewVar(PyTypeObject *tp, Py_ssize_t nitems)
258258
return PyObject_INIT_VAR(op, tp, nitems);
259259
}
260260

261-
/* Implementation of PyObject_Print with recursion checking */
262-
static int
263-
internal_print(PyObject *op, FILE *fp, int flags, int nesting)
261+
int
262+
PyObject_Print(PyObject *op, FILE *fp, int flags)
264263
{
265264
int ret = 0;
266-
if (nesting > 10) {
267-
PyErr_SetString(PyExc_RuntimeError, "print recursion");
268-
return -1;
269-
}
270265
if (PyErr_CheckSignals())
271266
return -1;
272267
#ifdef USE_STACKCHECK
@@ -333,12 +328,6 @@ internal_print(PyObject *op, FILE *fp, int flags, int nesting)
333328
return ret;
334329
}
335330

336-
int
337-
PyObject_Print(PyObject *op, FILE *fp, int flags)
338-
{
339-
return internal_print(op, fp, flags, 0);
340-
}
341-
342331
/* For debugging convenience. Set a breakpoint here and call it from your DLL */
343332
void
344333
_Py_BreakPoint(void)

0 commit comments

Comments
 (0)