Made more extensive usage of context managers with open.

This commit is contained in:
Claude Paroz 2012-05-05 14:01:38 +02:00
parent ec5423df05
commit 865cd35c9b
33 changed files with 178 additions and 233 deletions

View file

@ -239,9 +239,8 @@ Sample usage::
... link=u"http://www.holovaty.com/test/",
... description="Testing."
... )
>>> fp = open('test.rss', 'w')
>>> feed.write(fp, 'utf-8')
>>> fp.close()
>>> with open('test.rss', 'w') as fp:
>>> feed.write(fp, 'utf-8')
For simplifying the selection of a generator use ``feedgenerator.DefaultFeed``
which is currently ``Rss201rev2Feed``