diff options
author | Chandan Singh <csingh43@bloomberg.net> | 2019-01-25 13:22:22 +0000 |
---|---|---|
committer | Chandan Singh <chandan@chandansingh.net> | 2019-01-25 23:50:49 +0000 |
commit | a3e7aee896f753396268be2abbf57066269ddfe2 (patch) | |
tree | dccb3f2b4645dcfbdf1fded5ce5cb9f8bc3baef6 /setup.py | |
parent | 4edbbd27c295e3f5498d3e721941cb8a91da4fd3 (diff) | |
download | buildstream-a3e7aee896f753396268be2abbf57066269ddfe2.tar.gz |
setup.py: Do not error out when man directory is empty/missingchandan/toxic-man
If the `man` directory is empty, then it won't be copied in the source
distribution, and `list_man_pages()` will throw an exception when trying
to list files in a non-existent directory. This prevents us from
installing the BuildStream package when the man pages are not there.
The most common use-case for this is when we want to re-generate the man
pages but want to install the package before re-generating them.
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -109,8 +109,12 @@ def check_for_bwrap(): def list_man_pages(): bst_dir = os.path.dirname(os.path.abspath(__file__)) man_dir = os.path.join(bst_dir, 'man') - man_pages = os.listdir(man_dir) - return [os.path.join('man', page) for page in man_pages] + try: + man_pages = os.listdir(man_dir) + return [os.path.join('man', page) for page in man_pages] + except FileNotFoundError: + # Do not error out when 'man' directory does not exist + return [] ##################################################### |