'With' statement was introduced in py2.5. Be caution in case you would run it with older py version like py2.4.
http://www.python.org/dev/peps/pep-0343/