Browse files

[1.7.x] Edited in reuseable apps tutorial to use a context m…

…anager for open().

Backport of b8d2550 from master
  • Loading branch information...
1 parent 71ff570 commit 63ae8de8fcc2fff581608ff0587f6497b38ba909 @djds23 djds23 committed with timgraham Jul 15, 2014
Showing with 2 additions and 1 deletion.
  1. +2 −1 docs/intro/reusable-apps.txt
@@ -192,7 +192,8 @@ this. For a small app like polls, this process isn't too difficult.
import os
from setuptools import setup
- README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()
+ with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
# allow to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))

0 comments on commit 63ae8de

Please sign in to comment.