1
0
mirror of https://git.yoctoproject.org/poky synced 2026-07-15 15:37:03 +00:00

bitbake: cooker: use enum for cooker state to improve readability

enum was introduced in Python 3.4

(Bitbake rev: 35b71a94f8757fcca830f972a42edab1dd000c16)

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Chris Laplante
2024-12-04 12:30:11 -05:00
committed by Richard Purdie
parent 2a34c96b8b
commit 9cabda06ab
3 changed files with 32 additions and 34 deletions
+2 -2
View File
@@ -109,7 +109,7 @@ class Command:
def runAsyncCommand(self, _, process_server, halt):
try:
if self.cooker.state in (bb.cooker.state.error, bb.cooker.state.shutdown, bb.cooker.state.forceshutdown):
if self.cooker.state in (bb.cooker.State.ERROR, bb.cooker.State.SHUTDOWN, bb.cooker.State.FORCE_SHUTDOWN):
# updateCache will trigger a shutdown of the parser
# and then raise BBHandledException triggering an exit
self.cooker.updateCache()
@@ -119,7 +119,7 @@ class Command:
(command, options) = cmd
commandmethod = getattr(CommandsAsync, command)
needcache = getattr( commandmethod, "needcache" )
if needcache and self.cooker.state != bb.cooker.state.running:
if needcache and self.cooker.state != bb.cooker.State.RUNNING:
self.cooker.updateCache()
return True
else: