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

Skip to content

Commit 9154193

Browse files
committed
Back out 5bd9db528aed (issue #18408). It caused unsolved buildbot failures.
1 parent 0acbcb5 commit 9154193

2 files changed

Lines changed: 0 additions & 23 deletions

File tree

Objects/object.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -443,14 +443,6 @@ PyObject_Repr(PyObject *v)
443443
if (Py_TYPE(v)->tp_repr == NULL)
444444
return PyUnicode_FromFormat("<%s object at %p>",
445445
v->ob_type->tp_name, v);
446-
447-
#ifdef Py_DEBUG
448-
/* PyObject_Repr() must not be called with an exception set,
449-
because it may clear it (directly or indirectly) and so the
450-
caller looses its exception */
451-
assert(!PyErr_Occurred());
452-
#endif
453-
454446
res = (*v->ob_type->tp_repr)(v);
455447
if (res == NULL)
456448
return NULL;
@@ -482,7 +474,6 @@ PyObject_Str(PyObject *v)
482474
#endif
483475
if (v == NULL)
484476
return PyUnicode_FromString("<NULL>");
485-
486477
if (PyUnicode_CheckExact(v)) {
487478
#ifndef Py_DEBUG
488479
if (PyUnicode_READY(v) < 0)
@@ -494,13 +485,6 @@ PyObject_Str(PyObject *v)
494485
if (Py_TYPE(v)->tp_str == NULL)
495486
return PyObject_Repr(v);
496487

497-
#ifdef Py_DEBUG
498-
/* PyObject_Str() must not be called with an exception set,
499-
because it may clear it (directly or indirectly) and so the
500-
caller looses its exception */
501-
assert(!PyErr_Occurred());
502-
#endif
503-
504488
/* It is possible for a type to have a tp_str representation that loops
505489
infinitely. */
506490
if (Py_EnterRecursiveCall(" while getting the str of an object"))

Objects/typeobject.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -736,13 +736,6 @@ type_call(PyTypeObject *type, PyObject *args, PyObject *kwds)
736736
return NULL;
737737
}
738738

739-
#ifdef Py_DEBUG
740-
/* type_call() must not be called with an exception set,
741-
because it may clear it (directly or indirectly) and so the
742-
caller looses its exception */
743-
assert(!PyErr_Occurred());
744-
#endif
745-
746739
obj = type->tp_new(type, args, kwds);
747740
if (obj != NULL) {
748741
/* Ugly exception: when the call was type(something),

0 commit comments

Comments
 (0)