diff options
Diffstat (limited to 'bitbake/lib/bb/cookerdata.py')
-rw-r--r-- | bitbake/lib/bb/cookerdata.py | 18 |
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 @@ | |||
25 | import os, sys | 25 | import os, sys |
26 | from functools import wraps | 26 | from functools import wraps |
27 | import logging | 27 | import logging |
28 | import bb | ||
28 | from bb import data | 29 | from bb import data |
30 | import bb.parse | ||
29 | 31 | ||
30 | logger = logging.getLogger("BitBake") | 32 | logger = logging.getLogger("BitBake") |
31 | parselog = logging.getLogger("BitBake.Parsing") | 33 | parselog = 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 | |||
142 | def catch_parse_error(func): | 158 | def 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 |