aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/cooker.py
diff options
context:
space:
mode:
authorScott Garman <scott.a.garman@intel.com>2011-06-14 16:44:58 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-06-15 11:08:43 +0100
commitdbf5f42b06bef81749b13aa99945cc1292a6676d (patch)
tree04b6a3bdb3b4dfcae58ad0e233eb700317736984 /lib/bb/cooker.py
parent9bff182a4ba9571679985b45b309990a6eddad14 (diff)
downloadbitbake-dbf5f42b06bef81749b13aa99945cc1292a6676d.tar.gz
make exception handling syntax consistent
Update exception handling syntax to use the modern style: except ExcType as localvar Signed-off-by: Scott Garman <scott.a.garman@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/cooker.py')
-rw-r--r--lib/bb/cooker.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index da221664a..990d17bc8 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -100,7 +100,7 @@ class BBCooker:
name_array = (getattr(module, configuration.ui)).extraCaches
for recipeInfoName in name_array:
caches_name_array.append(recipeInfoName)
- except ImportError, exc:
+ except ImportError as exc:
# bb.ui.XXX is not defined and imported. It's an error!
logger.critical("Unable to import '%s' interface from bb.ui: %s" % (configuration.ui, exc))
sys.exit("FATAL: Failed to import '%s' interface." % configuration.ui)
@@ -117,7 +117,7 @@ class BBCooker:
module_name, cache_name = var.split(':')
module = __import__(module_name, fromlist=(cache_name,))
self.caches_array.append(getattr(module, cache_name))
- except ImportError, exc:
+ except ImportError as exc:
logger.critical("Unable to import extra RecipeInfo '%s' from '%s': %s" % (cache_name, module_name, exc))
sys.exit("FATAL: Failed to import extra cache class '%s'." % cache_name)
@@ -277,7 +277,7 @@ class BBCooker:
if fn:
try:
envdata = bb.cache.Cache.loadDataFull(fn, self.get_file_appends(fn), self.configuration.data)
- except Exception, e:
+ except Exception as e:
parselog.exception("Unable to read %s", fn)
raise
@@ -1155,7 +1155,7 @@ def parse_file(task):
filename, appends, caches_array = task
try:
return True, bb.cache.Cache.parse(filename, appends, parse_file.cfg, caches_array)
- except Exception, exc:
+ except Exception as exc:
tb = sys.exc_info()[2]
exc.recipe = filename
exc.traceback = list(bb.exceptions.extract_traceback(tb, context=3))
@@ -1163,7 +1163,7 @@ def parse_file(task):
# Need to turn BaseExceptions into Exceptions here so we gracefully shutdown
# and for example a worker thread doesn't just exit on its own in response to
# a SystemExit event for example.
- except BaseException, exc:
+ except BaseException as exc:
raise ParsingFailure(exc, filename)
class CookerParser(object):