[Notes] [Git][BuildStream/buildstream][chandan/toxic-man] setup.py: Do not error out when man directory is empty/missing



Title: GitLab

Chandan Singh pushed to branch chandan/toxic-man at BuildStream / buildstream

Commits:

1 changed file:

Changes:

  • setup.py
    ... ... @@ -109,8 +109,12 @@ def check_for_bwrap():
    109 109
     def list_man_pages():
    
    110 110
         bst_dir = os.path.dirname(os.path.abspath(__file__))
    
    111 111
         man_dir = os.path.join(bst_dir, 'man')
    
    112
    -    man_pages = os.listdir(man_dir)
    
    113
    -    return [os.path.join('man', page) for page in man_pages]
    
    112
    +    try:
    
    113
    +        man_pages = os.listdir(man_dir)
    
    114
    +        return [os.path.join('man', page) for page in man_pages]
    
    115
    +    except FileNotFoundError:
    
    116
    +        # Do not error out when 'man' directory does not exist
    
    117
    +        return []
    
    114 118
     
    
    115 119
     
    
    116 120
     #####################################################
    



  • [Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]