diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-10-09 17:46:17 +0100 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2021-10-29 04:48:40 -1000 |
commit | e0cecf7b4a4b966f11527a88e632997bdf74af96 (patch) | |
tree | 1f7c5a23ec80a3fa34c18956d243623d374a01bd | |
parent | f16803718a19ace7b582c5b73924fe3112502927 (diff) | |
download | openembedded-core-e0cecf7b4a4b966f11527a88e632997bdf74af96.tar.gz |
base: Clean up unneeded len() calls
This code pattern isn't very pythonic, improve it to drop the unneeded
len() calls.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 69376ac1a6147b26fe1abaa4cf68414024814d63)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r-- | meta/classes/base.bbclass | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index 8a1b5f79c1..a3e98d1b50 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass @@ -153,7 +153,7 @@ do_fetch[vardeps] += "SRCREV" python base_do_fetch() { src_uri = (d.getVar('SRC_URI') or "").split() - if len(src_uri) == 0: + if not src_uri: return try: @@ -170,7 +170,7 @@ do_unpack[cleandirs] = "${@d.getVar('S') if os.path.normpath(d.getVar('S')) != o python base_do_unpack() { src_uri = (d.getVar('SRC_URI') or "").split() - if len(src_uri) == 0: + if not src_uri: return try: @@ -688,7 +688,7 @@ python () { if os.path.basename(p) == machine and os.path.isdir(p): paths.append(p) - if len(paths) != 0: + if paths: for s in srcuri.split(): if not s.startswith("file://"): continue @@ -721,7 +721,7 @@ do_cleansstate[nostamp] = "1" python do_cleanall() { src_uri = (d.getVar('SRC_URI') or "").split() - if len(src_uri) == 0: + if not src_uri: return try: |