diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-10-09 17:46:17 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-10-14 22:32:50 +0100 |
commit | 2ef219407d512a934c58e0c3ea50901d9fadf598 (patch) | |
tree | b7297e51d2302f86d7ab5fe1e02dfa88ab4ed1e7 /meta/classes/base.bbclass | |
parent | 188a6e5895488f30caa6ce357e65266af31a938b (diff) | |
download | poky-2ef219407d512a934c58e0c3ea50901d9fadf598.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: 69376ac1a6147b26fe1abaa4cf68414024814d63)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/base.bbclass')
-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 1f980149de..c0dddcf174 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: |
@@ -693,7 +693,7 @@ python () { | |||
693 | if os.path.basename(p) == machine and os.path.isdir(p): | 693 | if os.path.basename(p) == machine and os.path.isdir(p): |
694 | paths.append(p) | 694 | paths.append(p) |
695 | 695 | ||
696 | if len(paths) != 0: | 696 | if paths: |
697 | for s in srcuri.split(): | 697 | for s in srcuri.split(): |
698 | if not s.startswith("file://"): | 698 | if not s.startswith("file://"): |
699 | continue | 699 | continue |
@@ -726,7 +726,7 @@ do_cleansstate[nostamp] = "1" | |||
726 | 726 | ||
727 | python do_cleanall() { | 727 | python do_cleanall() { |
728 | src_uri = (d.getVar('SRC_URI') or "").split() | 728 | src_uri = (d.getVar('SRC_URI') or "").split() |
729 | if len(src_uri) == 0: | 729 | if not src_uri: |
730 | return | 730 | return |
731 | 731 | ||
732 | try: | 732 | try: |