summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/parse
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-04-11 17:03:55 -0700
committerRichard Purdie <rpurdie@linux.intel.com>2010-07-02 15:41:33 +0100
commit1180bab54e2879401f3586c91a48174191a1ee8b (patch)
treea45aeee20eb5969cc1ac778fac47134929f4e021 /bitbake/lib/bb/parse
parent5b216c8000dbc3ed9f3e996242eb24269fcaf919 (diff)
downloadpoky-1180bab54e2879401f3586c91a48174191a1ee8b.tar.gz
Apply some 2to3 transforms that don't cause issues in 2.6
(Bitbake rev: d39ab776e7ceaefc8361150151cf0892dcb70d9c) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/parse')
-rw-r--r--bitbake/lib/bb/parse/__init__.py4
-rw-r--r--bitbake/lib/bb/parse/ast.py2
-rw-r--r--bitbake/lib/bb/parse/parse_py/BBHandler.py6
-rw-r--r--bitbake/lib/bb/parse/parse_py/ConfHandler.py2
4 files changed, 7 insertions, 7 deletions
diff --git a/bitbake/lib/bb/parse/__init__.py b/bitbake/lib/bb/parse/__init__.py
index adc1408b9e..4b957884cc 100644
--- a/bitbake/lib/bb/parse/__init__.py
+++ b/bitbake/lib/bb/parse/__init__.py
@@ -37,12 +37,12 @@ class SkipPackage(Exception):
37 37
38__mtime_cache = {} 38__mtime_cache = {}
39def cached_mtime(f): 39def cached_mtime(f):
40 if not __mtime_cache.has_key(f): 40 if f not in __mtime_cache:
41 __mtime_cache[f] = os.stat(f)[8] 41 __mtime_cache[f] = os.stat(f)[8]
42 return __mtime_cache[f] 42 return __mtime_cache[f]
43 43
44def cached_mtime_noerror(f): 44def cached_mtime_noerror(f):
45 if not __mtime_cache.has_key(f): 45 if f not in __mtime_cache:
46 try: 46 try:
47 __mtime_cache[f] = os.stat(f)[8] 47 __mtime_cache[f] = os.stat(f)[8]
48 except OSError: 48 except OSError:
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py
index a586c5cde1..e7d389e7a5 100644
--- a/bitbake/lib/bb/parse/ast.py
+++ b/bitbake/lib/bb/parse/ast.py
@@ -311,7 +311,7 @@ def finalize(fn, d):
311 all_handlers = {} 311 all_handlers = {}
312 for var in bb.data.getVar('__BBHANDLERS', d) or []: 312 for var in bb.data.getVar('__BBHANDLERS', d) or []:
313 # try to add the handler 313 # try to add the handler
314 handler = bb.data.getVar(var,d) 314 handler = bb.data.getVar(var, d)
315 bb.event.register(var, handler) 315 bb.event.register(var, handler)
316 316
317 tasklist = bb.data.getVar('__BBTASKS', d) or [] 317 tasklist = bb.data.getVar('__BBTASKS', d) or []
diff --git a/bitbake/lib/bb/parse/parse_py/BBHandler.py b/bitbake/lib/bb/parse/parse_py/BBHandler.py
index a770131fbc..a388773bb7 100644
--- a/bitbake/lib/bb/parse/parse_py/BBHandler.py
+++ b/bitbake/lib/bb/parse/parse_py/BBHandler.py
@@ -90,7 +90,7 @@ def get_statements(filename, absolsute_filename, base_name):
90 statements = ast.StatementGroup() 90 statements = ast.StatementGroup()
91 91
92 lineno = 0 92 lineno = 0
93 while 1: 93 while True:
94 lineno = lineno + 1 94 lineno = lineno + 1
95 s = file.readline() 95 s = file.readline()
96 if not s: break 96 if not s: break
@@ -118,7 +118,7 @@ def handle(fn, d, include):
118 bb.msg.debug(2, bb.msg.domain.Parsing, "BB " + fn + ": handle(data, include)") 118 bb.msg.debug(2, bb.msg.domain.Parsing, "BB " + fn + ": handle(data, include)")
119 119
120 (root, ext) = os.path.splitext(os.path.basename(fn)) 120 (root, ext) = os.path.splitext(os.path.basename(fn))
121 base_name = "%s%s" % (root,ext) 121 base_name = "%s%s" % (root, ext)
122 init(d) 122 init(d)
123 123
124 if ext == ".bbclass": 124 if ext == ".bbclass":
@@ -164,7 +164,7 @@ def handle(fn, d, include):
164 return d 164 return d
165 165
166def feeder(lineno, s, fn, root, statements): 166def feeder(lineno, s, fn, root, statements):
167 global __func_start_regexp__, __inherit_regexp__, __export_func_regexp__, __addtask_regexp__, __addhandler_regexp__, __def_regexp__, __python_func_regexp__, __inpython__,__infunc__, __body__, classes, bb, __residue__ 167 global __func_start_regexp__, __inherit_regexp__, __export_func_regexp__, __addtask_regexp__, __addhandler_regexp__, __def_regexp__, __python_func_regexp__, __inpython__, __infunc__, __body__, classes, bb, __residue__
168 if __infunc__: 168 if __infunc__:
169 if s == '}': 169 if s == '}':
170 __body__.append('') 170 __body__.append('')
diff --git a/bitbake/lib/bb/parse/parse_py/ConfHandler.py b/bitbake/lib/bb/parse/parse_py/ConfHandler.py
index 8e17182ba7..9188119e4d 100644
--- a/bitbake/lib/bb/parse/parse_py/ConfHandler.py
+++ b/bitbake/lib/bb/parse/parse_py/ConfHandler.py
@@ -89,7 +89,7 @@ def handle(fn, data, include):
89 89
90 statements = ast.StatementGroup() 90 statements = ast.StatementGroup()
91 lineno = 0 91 lineno = 0
92 while 1: 92 while True:
93 lineno = lineno + 1 93 lineno = lineno + 1
94 s = f.readline() 94 s = f.readline()
95 if not s: break 95 if not s: break