diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2014-06-15 12:43:43 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2014-06-15 12:43:43 -0400 |
commit | 4e11f3268eea3f883bfcc8494972570f95489c3f (patch) | |
tree | 0d35e1dc484b724f8c36a5f1ba1de8543644db8c /setup.py | |
parent | 9e3a1d2cf6b474895641a4914c09d6127c4ea8a9 (diff) | |
download | python-setuptools-bitbucket-4e11f3268eea3f883bfcc8494972570f95489c3f.tar.gz |
Use iterables to determine the best filename to use for changes.
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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() |