diff options
author | Guido van Rossum <guido@python.org> | 2006-02-28 21:57:43 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2006-02-28 21:57:43 +0000 |
commit | 437a2e31793b86a0a8f2bf1d6f1a786a111540a3 (patch) | |
tree | 73cebb12fcf159603815a40127540b55cc7dfd24 /Python/errors.c | |
parent | fabb57675972d7648c02f6baffd54f64f82ea069 (diff) | |
download | cpython-437a2e31793b86a0a8f2bf1d6f1a786a111540a3.tar.gz |
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.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Python/errors.c b/Python/errors.c index cbcc6facaf..c33bd13bde 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; } |