diff options
author | Chris Laplante <chris.laplante@agilent.com> | 2020-07-31 11:42:47 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-08-08 09:19:34 +0100 |
commit | 9b41300d47301121517b811e29806c9c2efa18b2 (patch) | |
tree | 61067db222204f2cd649a71f5149e8e4108cb5ac /bitbake | |
parent | e4e67563083c773f5f35de2a209271ff7990ff29 (diff) | |
download | poky-9b41300d47301121517b811e29806c9c2efa18b2.tar.gz |
bitbake: progress: fix hypothetical NameError if 'progress' isn't set
(Bitbake rev: ff821022ef1fdf05482590d8e4fe003abf227135)
Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/progress.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/bitbake/lib/bb/progress.py b/bitbake/lib/bb/progress.py index b4e9bf0f29..8cddefaebe 100644 --- a/bitbake/lib/bb/progress.py +++ b/bitbake/lib/bb/progress.py | |||
@@ -204,6 +204,7 @@ class MultiStageProgressReporter: | |||
204 | value is considered to be out of stage_total, otherwise it should | 204 | value is considered to be out of stage_total, otherwise it should |
205 | be a percentage value from 0 to 100. | 205 | be a percentage value from 0 to 100. |
206 | """ | 206 | """ |
207 | progress = None | ||
207 | if self._stage_total: | 208 | if self._stage_total: |
208 | stage_progress = (float(stage_progress) / self._stage_total) * 100 | 209 | stage_progress = (float(stage_progress) / self._stage_total) * 100 |
209 | if self._stage < 0: | 210 | if self._stage < 0: |
@@ -212,9 +213,10 @@ class MultiStageProgressReporter: | |||
212 | progress = self._base_progress + (stage_progress * self._stage_weights[self._stage]) | 213 | progress = self._base_progress + (stage_progress * self._stage_weights[self._stage]) |
213 | else: | 214 | else: |
214 | progress = self._base_progress | 215 | progress = self._base_progress |
215 | if progress > 100: | 216 | if progress: |
216 | progress = 100 | 217 | if progress > 100: |
217 | self._fire_progress(progress) | 218 | progress = 100 |
219 | self._fire_progress(progress) | ||
218 | 220 | ||
219 | def finish(self): | 221 | def finish(self): |
220 | if self._finished: | 222 | if self._finished: |