Better logic for parsing percent-done output from Big Sur's softwareupdate

This commit is contained in:
Greg Neagle
2020-09-27 14:27:33 -07:00
parent 6d43e98130
commit aea9ffd3e8

View File

@@ -327,7 +327,7 @@ def run(options_list, catalog_url=None, stop_allowed=False):
# Snow Leopard/Lion progress info with '-v' flag
# Big Sur has 'downloading/Downloading' percent-done
try:
percent = int(output[10:].rstrip('%'))
percent = int(output.partition(". ")[2].rstrip('%'))
except ValueError:
percent = -1
display.display_percent_done(percent, 100)