summaryrefslogtreecommitdiffstats
path: root/Objects/object.c
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2013-08-23 21:18:20 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2013-08-23 21:18:20 (GMT)
commit91541931f5fc58cb7f8406d1e174cb805dacdfa2 (patch)
tree6a5afcd3598736dd6cdd2e6d6af02df581b14866 /Objects/object.c
parent0acbcb5bbeec87e3a8fae872a0368a4e297a8e8a (diff)
downloadcpython-91541931f5fc58cb7f8406d1e174cb805dacdfa2.zip
cpython-91541931f5fc58cb7f8406d1e174cb805dacdfa2.tar.gz
cpython-91541931f5fc58cb7f8406d1e174cb805dacdfa2.tar.bz2
Back out 5bd9db528aed (issue #18408). It caused unsolved buildbot failures.
Diffstat (limited to 'Objects/object.c')
-rw-r--r--Objects/object.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/Objects/object.c b/Objects/object.c
index 8d4fe42..81d6d4b 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -443,14 +443,6 @@ PyObject_Repr(PyObject *v)
if (Py_TYPE(v)->tp_repr == NULL)
return PyUnicode_FromFormat("<%s object at %p>",
v->ob_type->tp_name, v);
-
-#ifdef Py_DEBUG
- /* PyObject_Repr() must not be called with an exception set,
- because it may clear it (directly or indirectly) and so the
- caller looses its exception */
- assert(!PyErr_Occurred());
-#endif
-
res = (*v->ob_type->tp_repr)(v);
if (res == NULL)
return NULL;
@@ -482,7 +474,6 @@ PyObject_Str(PyObject *v)
#endif
if (v == NULL)
return PyUnicode_FromString("<NULL>");
-
if (PyUnicode_CheckExact(v)) {
#ifndef Py_DEBUG
if (PyUnicode_READY(v) < 0)
@@ -494,13 +485,6 @@ PyObject_Str(PyObject *v)
if (Py_TYPE(v)->tp_str == NULL)
return PyObject_Repr(v);
-#ifdef Py_DEBUG
- /* PyObject_Str() must not be called with an exception set,
- because it may clear it (directly or indirectly) and so the
- caller looses its exception */
- assert(!PyErr_Occurred());
-#endif
-
/* It is possible for a type to have a tp_str representation that loops
infinitely. */
if (Py_EnterRecursiveCall(" while getting the str of an object"))