summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/cookerdata.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/cookerdata.py')
-rw-r--r--bitbake/lib/bb/cookerdata.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py
index 149878f402..1bed455d16 100644
--- a/bitbake/lib/bb/cookerdata.py
+++ b/bitbake/lib/bb/cookerdata.py
@@ -25,7 +25,9 @@
25import os, sys 25import os, sys
26from functools import wraps 26from functools import wraps
27import logging 27import logging
28import bb
28from bb import data 29from bb import data
30import bb.parse
29 31
30logger = logging.getLogger("BitBake") 32logger = logging.getLogger("BitBake")
31parselog = logging.getLogger("BitBake.Parsing") 33parselog = logging.getLogger("BitBake.Parsing")
@@ -139,6 +141,20 @@ class CookerConfiguration(object):
139 def setServerRegIdleCallback(self, srcb): 141 def setServerRegIdleCallback(self, srcb):
140 self.server_register_idlecallback = srcb 142 self.server_register_idlecallback = srcb
141 143
144 def __getstate__(self):
145 state = {}
146 for key in self.__dict__.keys():
147 if key == "server_register_idlecallback":
148 state[key] = None
149 else:
150 state[key] = getattr(self, key)
151 return state
152
153 def __setstate__(self,state):
154 for k in state:
155 setattr(self, k, state[k])
156
157
142def catch_parse_error(func): 158def catch_parse_error(func):
143 """Exception handling bits for our parsing""" 159 """Exception handling bits for our parsing"""
144 @wraps(func) 160 @wraps(func)
@@ -146,6 +162,8 @@ def catch_parse_error(func):
146 try: 162 try:
147 return func(fn, *args) 163 return func(fn, *args)
148 except (IOError, bb.parse.ParseError, bb.data_smart.ExpansionError) as exc: 164 except (IOError, bb.parse.ParseError, bb.data_smart.ExpansionError) as exc:
165 import traceback
166 parselog.critical( traceback.format_exc())
149 parselog.critical("Unable to parse %s: %s" % (fn, exc)) 167 parselog.critical("Unable to parse %s: %s" % (fn, exc))
150 sys.exit(1) 168 sys.exit(1)
151 return wrapped 169 return wrapped