[Python-checkins] cpython (merge default -> default): Merge heads

serhiy.storchaka python-checkins at python.org
Fri Aug 23 23:45:28 CEST 2013


http://hg.python.org/cpython/rev/c368e43859ba
changeset:   85358:c368e43859ba
parent:      85356:383d85249997
parent:      85354:42aecc601a41
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Sat Aug 24 00:42:54 2013 +0300
summary:
  Merge heads

files:
  Objects/object.c     |  16 ----------------
  Objects/typeobject.c |   7 -------
  2 files changed, 0 insertions(+), 23 deletions(-)


diff --git a/Objects/object.c b/Objects/object.c
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -443,14 +443,6 @@
     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 @@
 #endif
     if (v == NULL)
         return PyUnicode_FromString("<NULL>");
-
     if (PyUnicode_CheckExact(v)) {
 #ifndef Py_DEBUG
         if (PyUnicode_READY(v) < 0)
@@ -494,13 +485,6 @@
     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"))
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -736,13 +736,6 @@
         return NULL;
     }
 
-#ifdef Py_DEBUG
-    /* type_call() 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
-
     obj = type->tp_new(type, args, kwds);
     if (obj != NULL) {
         /* Ugly exception: when the call was type(something),

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list