Mercurial > cpython-lru_cache-weakref
diff Python/errors.c @ 36737:fa92fe15251a legacy-trunk
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.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Tue, 28 Feb 2006 21:57:43 +0000 |
| parents | e3248f1fc54d |
| children | 8e04de2480e4 |
line wrap: on
line diff
--- a/Python/errors.c Tue Feb 28 21:41:30 2006 +0000 +++ b/Python/errors.c Tue Feb 28 21:57:43 2006 +0000 @@ -24,6 +24,7 @@ if (traceback != NULL && !PyTraceBack_Check(traceback)) { /* XXX Should never happen -- fatal error instead? */ + /* Well, it could be None. */ Py_DECREF(traceback); traceback = NULL; }
