summaryrefslogtreecommitdiffstats
path: root/lib/bb/parse/parse_py
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2006-02-26 11:07:47 +0000
committerHolger Hans Peter Freyther <zecke@selfish.org>2006-02-26 11:07:47 +0000
commit4f807c93f8f72eb73b8600d1f73a3e26014a3167 (patch)
tree7e1d0b5a52c45081238da4c067e9c462a20a7198 /lib/bb/parse/parse_py
parent7dc97df197bde5dde7fffad737f493b0cb94c576 (diff)
downloadbitbake-4f807c93f8f72eb73b8600d1f73a3e26014a3167.tar.gz
bitbake/parser,build,utils:
We compile strings into code. In case of erros the traceback is not useful at all. It doesn't print the function name, accurate line number etc. Introduce a better_compile method that excepts the Error and prints the surrounding lines of code. We make use of it on the parsing level and execution level of python methods.
Diffstat (limited to 'lib/bb/parse/parse_py')
-rw-r--r--lib/bb/parse/parse_py/BBHandler.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/bb/parse/parse_py/BBHandler.py b/lib/bb/parse/parse_py/BBHandler.py
index fac3e85b3..d083bb312 100644
--- a/lib/bb/parse/parse_py/BBHandler.py
+++ b/lib/bb/parse/parse_py/BBHandler.py
@@ -22,7 +22,7 @@
Place, Suite 330, Boston, MA 02111-1307 USA."""
import re, bb, os, sys
-import bb.fetch, bb.build
+import bb.fetch, bb.build, bb.utils
from bb import debug, data, fetch, fatal
from ConfHandler import include, localpath, obtain, init
@@ -206,7 +206,7 @@ def feeder(lineno, s, fn, d):
return
else:
text = '\n'.join(__body__)
- comp = compile(text, "<bb>", "exec")
+ comp = bb.utils.better_compile(text, "<bb>", fn )
exec comp in __builtins__
__body__ = []
__inpython__ = False