aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2014-06-15 12:43:43 -0400
committerJason R. Coombs <jaraco@jaraco.com>2014-06-15 12:43:43 -0400
commit8ddfbc2a194b35a39427e18381b0f63d4323e9a0 (patch)
tree60ff266df3b36ce329995f7be2780fce31d85994
parent184e94ebbb8324496fdfd3510aa5767028586736 (diff)
downloadexternal_python_setuptools-8ddfbc2a194b35a39427e18381b0f63d4323e9a0.tar.gz
external_python_setuptools-8ddfbc2a194b35a39427e18381b0f63d4323e9a0.tar.bz2
external_python_setuptools-8ddfbc2a194b35a39427e18381b0f63d4323e9a0.zip
Use iterables to determine the best filename to use for changes.
-rwxr-xr-xsetup.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/setup.py b/setup.py
index 54a86e8b..1c2e0234 100755
--- a/setup.py
+++ b/setup.py
@@ -90,12 +90,12 @@ class test(_test):
readme_file = io.open('README.txt', encoding='utf-8')
-# the release script adds hyperlinks to issues
-if os.path.exists('CHANGES (links).txt'):
- changes_file = io.open('CHANGES (links).txt', encoding='utf-8')
-else:
- # but if the release script has not run, fall back to the source file
- changes_file = io.open('CHANGES.txt', encoding='utf-8')
+# The release script adds hyperlinks to issues,
+# but if the release script has not run, fall back to the source file
+changes_names = 'CHANGES (links).txt', 'CHANGES.txt'
+changes_fn = next(filter(os.path.exists, changes_names))
+changes_file = io.open(changes_fn, encoding='utf-8')
+
with readme_file:
with changes_file:
long_description = readme_file.read() + '\n' + changes_file.read()