summaryrefslogtreecommitdiffstats
path: root/Python/errors.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2006-02-28 21:57:43 (GMT)
committerGuido van Rossum <guido@python.org>2006-02-28 21:57:43 (GMT)
commit1a5e21e0334a6d4e1c756575023c7157fc9ee306 (patch)
treed2c1c9383b3c6d8194449ae756e663b0b0ac9e4e /Python/errors.c
parent87a8b4fee56b8204ee9f7b0ce2e5db0564e8f86e (diff)
downloadcpython-1a5e21e0334a6d4e1c756575023c7157fc9ee306.zip
cpython-1a5e21e0334a6d4e1c756575023c7157fc9ee306.tar.gz
cpython-1a5e21e0334a6d4e1c756575023c7157fc9ee306.tar.bz2
Updates to the with-statement:
- New semantics for __exit__() -- it must re-raise the exception if type is not None; the with-statement itself doesn't do this. (See the updated PEP for motivation.) - Added context managers to: - file - thread.LockType - threading.{Lock,RLock,Condition,Semaphore,BoundedSemaphore} - decimal.Context - Added contextlib.py, which defines @contextmanager, nested(), closing(). - Unit tests all around; bot no docs yet.
Diffstat (limited to 'Python/errors.c')
-rw-r--r--Python/errors.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Python/errors.c b/Python/errors.c
index cbcc6fa..c33bd13 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -24,6 +24,7 @@ PyErr_Restore(PyObject *type, PyObject *value, PyObject *traceback)
if (traceback != NULL && !PyTraceBack_Check(traceback)) {
/* XXX Should never happen -- fatal error instead? */
+ /* Well, it could be None. */
Py_DECREF(traceback);
traceback = NULL;
}