diff options
| author | Dean Silfen <dean.silfen@gmail.com> | 2014-07-15 12:43:52 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-07-16 14:26:04 -0400 |
| commit | 63ae8de8fcc2fff581608ff0587f6497b38ba909 (patch) | |
| tree | 09ba4bdc076df5c1cec46ef1ec2a1eb160b5711c /docs/intro | |
| parent | 71ff5708b4f9b5a9e080531a1e307cad87bccfc5 (diff) | |
[1.7.x] Edited setup.py in reuseable apps tutorial to use a context manager for open().
Backport of b8d255071e from master
Diffstat (limited to 'docs/intro')
| -rw-r--r-- | docs/intro/reusable-apps.txt | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/docs/intro/reusable-apps.txt b/docs/intro/reusable-apps.txt index 7f1d984d1f..a32614285a 100644 --- a/docs/intro/reusable-apps.txt +++ b/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: + README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) |
