diff options
author | Chris Laplante <chris.laplante@agilent.com> | 2024-12-04 12:30:11 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-12-06 23:33:54 +0000 |
commit | 9cabda06ab20ade43e7f9ac9b27c3ff92821e202 (patch) | |
tree | f7850868c6ae08ab70642de1869cecf6c7b51bed /bitbake/lib/bb/command.py | |
parent | 2a34c96b8bfd89fdc3f89b1f072fe1b8b33da7a4 (diff) | |
download | poky-9cabda06ab20ade43e7f9ac9b27c3ff92821e202.tar.gz |
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>
Diffstat (limited to 'bitbake/lib/bb/command.py')
-rw-r--r-- | bitbake/lib/bb/command.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py index a634276608..7944faf981 100644 --- a/bitbake/lib/bb/command.py +++ b/bitbake/lib/bb/command.py | |||
@@ -109,7 +109,7 @@ class Command: | |||
109 | 109 | ||
110 | def runAsyncCommand(self, _, process_server, halt): | 110 | def runAsyncCommand(self, _, process_server, halt): |
111 | try: | 111 | try: |
112 | if self.cooker.state in (bb.cooker.state.error, bb.cooker.state.shutdown, bb.cooker.state.forceshutdown): | 112 | if self.cooker.state in (bb.cooker.State.ERROR, bb.cooker.State.SHUTDOWN, bb.cooker.State.FORCE_SHUTDOWN): |
113 | # updateCache will trigger a shutdown of the parser | 113 | # updateCache will trigger a shutdown of the parser |
114 | # and then raise BBHandledException triggering an exit | 114 | # and then raise BBHandledException triggering an exit |
115 | self.cooker.updateCache() | 115 | self.cooker.updateCache() |
@@ -119,7 +119,7 @@ class Command: | |||
119 | (command, options) = cmd | 119 | (command, options) = cmd |
120 | commandmethod = getattr(CommandsAsync, command) | 120 | commandmethod = getattr(CommandsAsync, command) |
121 | needcache = getattr( commandmethod, "needcache" ) | 121 | needcache = getattr( commandmethod, "needcache" ) |
122 | if needcache and self.cooker.state != bb.cooker.state.running: | 122 | if needcache and self.cooker.state != bb.cooker.State.RUNNING: |
123 | self.cooker.updateCache() | 123 | self.cooker.updateCache() |
124 | return True | 124 | return True |
125 | else: | 125 | else: |