fix for division by 0 problem for projects without any modules
This commit is contained in:
parent
a72f7f6eba
commit
8c38f35167
@ -194,9 +194,11 @@ def fetch_modules(config, module_directory):
|
||||
config.sections()))
|
||||
n = len(l)
|
||||
|
||||
list_of_modules = []
|
||||
|
||||
if n > 0: # otherwise division by zero in print_progress_bar
|
||||
i = 0
|
||||
print_progress_bar(text='- fetching modules:', done=0, total=n, width=30)
|
||||
list_of_modules = []
|
||||
for section in config.sections():
|
||||
if config.has_option(section, 'source'):
|
||||
for src in config.get(section, 'source').split('\n'):
|
||||
@ -219,6 +221,7 @@ def fetch_modules(config, module_directory):
|
||||
width=30
|
||||
)
|
||||
print('')
|
||||
|
||||
return list_of_modules
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user