diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-10-09 17:46:17 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-11-03 11:18:56 +0000 |
commit | f81f505f131b6bd83bef6abce26c6e734e55188b (patch) | |
tree | 7fa9cb0f7881896dec04942fea80979b0fccb198 /meta | |
parent | 3f2e26f122e540e997e422ca6b697f7a67a9e630 (diff) | |
download | poky-f81f505f131b6bd83bef6abce26c6e734e55188b.tar.gz |
base: Clean up unneeded len() calls
This code pattern isn't very pythonic, improve it to drop the unneeded
len() calls.
(From OE-Core rev: e0cecf7b4a4b966f11527a88e632997bdf74af96)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 69376ac1a6147b26fe1abaa4cf68414024814d63)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-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" | |||
153 | python base_do_fetch() { | 153 | python base_do_fetch() { |
154 | 154 | ||
155 | src_uri = (d.getVar('SRC_URI') or "").split() | 155 | src_uri = (d.getVar('SRC_URI') or "").split() |
156 | if len(src_uri) == 0: | 156 | if not src_uri: |
157 | return | 157 | return |
158 | 158 | ||
159 | try: | 159 | try: |
@@ -170,7 +170,7 @@ do_unpack[cleandirs] = "${@d.getVar('S') if os.path.normpath(d.getVar('S')) != o | |||
170 | 170 | ||
171 | python base_do_unpack() { | 171 | python base_do_unpack() { |
172 | src_uri = (d.getVar('SRC_URI') or "").split() | 172 | src_uri = (d.getVar('SRC_URI') or "").split() |
173 | if len(src_uri) == 0: | 173 | if not src_uri: |
174 | return | 174 | return |
175 | 175 | ||
176 | try: | 176 | try: |
@@ -688,7 +688,7 @@ python () { | |||
688 | if os.path.basename(p) == machine and os.path.isdir(p): | 688 | if os.path.basename(p) == machine and os.path.isdir(p): |
689 | paths.append(p) | 689 | paths.append(p) |
690 | 690 | ||
691 | if len(paths) != 0: | 691 | if paths: |
692 | for s in srcuri.split(): | 692 | for s in srcuri.split(): |
693 | if not s.startswith("file://"): | 693 | if not s.startswith("file://"): |
694 | continue | 694 | continue |
@@ -721,7 +721,7 @@ do_cleansstate[nostamp] = "1" | |||
721 | 721 | ||
722 | python do_cleanall() { | 722 | python do_cleanall() { |
723 | src_uri = (d.getVar('SRC_URI') or "").split() | 723 | src_uri = (d.getVar('SRC_URI') or "").split() |
724 | if len(src_uri) == 0: | 724 | if not src_uri: |
725 | return | 725 | return |
726 | 726 | ||
727 | try: | 727 | try: |