I saw some code in the Whoosh documentation:
with ix.searcher() as searcher: query = QueryParser(\"content\", ix.schema).parse(u\"ship\") results = searc
Read http://www.python.org/dev/peps/pep-0343/ it explains what the with statement is and how it looks in try .. finally form.
try .. finally