Add context-manager support to libhtml so it can be used in a "with" statement

svn: r12616
This commit is contained in:
Gerald Britton 2009-06-02 19:23:38 +00:00
parent 885ddddbc1
commit 32f0251b9e

View File

@ -530,6 +530,12 @@ class Html(list):
if len(self) > 2:
self[:] = self[:1] + self[-1:]
inside = property(__getinside, __setinside, __delinside)
#
def __enter__(self):
return self
#
def __exit__(self, exc_type, exc_val, exc_tb):
return exc_type is None
# ------------------------------------------
#