summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/codeparser.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/codeparser.py')
-rw-r--r--bitbake/lib/bb/codeparser.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/bitbake/lib/bb/codeparser.py b/bitbake/lib/bb/codeparser.py
index 951bd47b88..7d40835cb8 100644
--- a/bitbake/lib/bb/codeparser.py
+++ b/bitbake/lib/bb/codeparser.py
@@ -15,7 +15,14 @@ except ImportError:
15def check_indent(codestr): 15def check_indent(codestr):
16 """If the code is indented, add a top level piece of code to 'remove' the indentation""" 16 """If the code is indented, add a top level piece of code to 'remove' the indentation"""
17 17
18 if codestr[0] is " " or codestr[0] is " ": 18 i = 0
19 while codestr[i] in ["\n", " ", " "]:
20 i = i + 1
21
22 if i == 0:
23 return codestr
24
25 if codestr[i-1] is " " or codestr[i-1] is " ":
19 return "if 1:\n" + codestr 26 return "if 1:\n" + codestr
20 27
21 return codestr 28 return codestr