1
0
mirror of https://github.com/django/django.git synced 2025-03-24 00:00:45 +00:00

Edited setup.py in reuseable apps tutorial to use a context manager for open().

This commit is contained in:
Dean Silfen 2014-07-15 12:43:52 -04:00 committed by Tim Graham
parent e7827b9494
commit b8d255071e

View File

@ -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)))