mirror of
git://git.yoctoproject.org/poky
synced 2026-08-15 06:08:05 +00:00
bitbake/codeparser: Deal with functions with trailing whitespace
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
parent
1c24729697
commit
647713050b
@ -15,7 +15,14 @@ except ImportError:
|
||||
def check_indent(codestr):
|
||||
"""If the code is indented, add a top level piece of code to 'remove' the indentation"""
|
||||
|
||||
if codestr[0] is " " or codestr[0] is " ":
|
||||
i = 0
|
||||
while codestr[i] in ["\n", " ", " "]:
|
||||
i = i + 1
|
||||
|
||||
if i == 0:
|
||||
return codestr
|
||||
|
||||
if codestr[i-1] is " " or codestr[i-1] is " ":
|
||||
return "if 1:\n" + codestr
|
||||
|
||||
return codestr
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user