aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-07 13:55:56 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-09 14:04:18 +0100
commitf4b382754603d3f1caa13824bcc8d06b568bbc59 (patch)
treee44c1a10d5863dd96522d3642419413523c2ec90
parentec74285bd2108f12f33fc8ac0dc1d124ab48be21 (diff)
downloadopenembedded-core-contrib-f4b382754603d3f1caa13824bcc8d06b568bbc59.tar.gz
openembedded-core-contrib-f4b382754603d3f1caa13824bcc8d06b568bbc59.tar.bz2
openembedded-core-contrib-f4b382754603d3f1caa13824bcc8d06b568bbc59.zip
classes: Use modern exception raising syntax
Modern expection rasing syntax is function call format, convert to this to keep python 3 happy and model correct coding style in the core. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/gtk-immodules-cache.bbclass2
-rw-r--r--meta/classes/systemd.bbclass4
-rw-r--r--meta/classes/update-alternatives.bbclass4
-rw-r--r--meta/classes/update-rc.d.bbclass4
-rw-r--r--meta/classes/useradd.bbclass4
5 files changed, 9 insertions, 9 deletions
diff --git a/meta/classes/gtk-immodules-cache.bbclass b/meta/classes/gtk-immodules-cache.bbclass
index ed3069daafd..e11ed222d6a 100644
--- a/meta/classes/gtk-immodules-cache.bbclass
+++ b/meta/classes/gtk-immodules-cache.bbclass
@@ -78,6 +78,6 @@ python __anonymous() {
gtkimmodules_check = d.getVar('GTKIMMODULES_PACKAGES')
if not gtkimmodules_check:
bb_filename = d.getVar('FILE')
- raise bb.build.FuncFailed, "\n\n\nERROR: %s inherits gtk-immodule-cache but doesn't set GTKIMMODULES_PACKAGE" % bb_filename
+ raise bb.build.FuncFailed("ERROR: %s inherits gtk-immodule-cache but doesn't set GTKIMMODULES_PACKAGE" % bb_filename)
}
diff --git a/meta/classes/systemd.bbclass b/meta/classes/systemd.bbclass
index 8084251f138..86d9a9a835f 100644
--- a/meta/classes/systemd.bbclass
+++ b/meta/classes/systemd.bbclass
@@ -146,8 +146,8 @@ python systemd_populate_packages() {
if path_found != '':
systemd_add_files_and_parse(pkg_systemd, path_found, service, keys)
else:
- raise bb.build.FuncFailed, "\n\nSYSTEMD_SERVICE_%s value %s does not exist" % \
- (pkg_systemd, service)
+ raise bb.build.FuncFailed("SYSTEMD_SERVICE_%s value %s does not exist" % \
+ (pkg_systemd, service))
# Run all modifications once when creating package
if os.path.exists(d.getVar("D", True)):
diff --git a/meta/classes/update-alternatives.bbclass b/meta/classes/update-alternatives.bbclass
index 45f4291aa26..2cadaf79e3b 100644
--- a/meta/classes/update-alternatives.bbclass
+++ b/meta/classes/update-alternatives.bbclass
@@ -128,9 +128,9 @@ def update_alternatives_after_parse(d):
alt_path = d.getVar('ALTERNATIVE_PATH', True)
alt_link = d.getVar('ALTERNATIVE_LINK', True) or ("%s/%s" % (d.getVar('bindir', True), alt_name))
if alt_name == None:
- raise bb.build.build.FuncFailed, "%s inherits update-alternatives but doesn't set ALTERNATIVE_NAME" % d.getVar('FILE')
+ raise bb.build.build.FuncFailed("%s inherits update-alternatives but doesn't set ALTERNATIVE_NAME" % d.getVar('FILE'))
if alt_path == None:
- raise bb.build.build.FuncFailed, "%s inherits update-alternatives but doesn't set ALTERNATIVE_PATH" % d.getVar('FILE')
+ raise bb.build.build.FuncFailed("%s inherits update-alternatives but doesn't set ALTERNATIVE_PATH" % d.getVar('FILE'))
alternative = d.getVar('ALTERNATIVE_%s' % pn, True) or ""
alternative += " " + alt_name
diff --git a/meta/classes/update-rc.d.bbclass b/meta/classes/update-rc.d.bbclass
index d8cc34234ef..55885698ae9 100644
--- a/meta/classes/update-rc.d.bbclass
+++ b/meta/classes/update-rc.d.bbclass
@@ -44,9 +44,9 @@ fi
def update_rc_after_parse(d):
if d.getVar('INITSCRIPT_PACKAGES') == None:
if d.getVar('INITSCRIPT_NAME') == None:
- raise bb.build.FuncFailed, "%s inherits update-rc.d but doesn't set INITSCRIPT_NAME" % d.getVar('FILE')
+ raise bb.build.FuncFailed("%s inherits update-rc.d but doesn't set INITSCRIPT_NAME" % d.getVar('FILE'))
if d.getVar('INITSCRIPT_PARAMS') == None:
- raise bb.build.FuncFailed, "%s inherits update-rc.d but doesn't set INITSCRIPT_PARAMS" % d.getVar('FILE')
+ raise bb.build.FuncFailed("%s inherits update-rc.d but doesn't set INITSCRIPT_PARAMS" % d.getVar('FILE'))
python __anonymous() {
update_rc_after_parse(d)
diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass
index 0a4febadc8a..52c0ba4ec18 100644
--- a/meta/classes/useradd.bbclass
+++ b/meta/classes/useradd.bbclass
@@ -157,11 +157,11 @@ def update_useradd_after_parse(d):
useradd_packages = d.getVar('USERADD_PACKAGES', True)
if not useradd_packages:
- raise bb.build.FuncFailed, "%s inherits useradd but doesn't set USERADD_PACKAGES" % d.getVar('FILE')
+ raise bb.build.FuncFailed("%s inherits useradd but doesn't set USERADD_PACKAGES" % d.getVar('FILE'))
for pkg in useradd_packages.split():
if not d.getVar('USERADD_PARAM_%s' % pkg, True) and not d.getVar('GROUPADD_PARAM_%s' % pkg, True):
- raise bb.build.FuncFailed, "%s inherits useradd but doesn't set USERADD_PARAM or GROUPADD_PARAM for package %s" % (d.getVar('FILE'), pkg)
+ raise bb.build.FuncFailed("%s inherits useradd but doesn't set USERADD_PARAM or GROUPADD_PARAM for package %s" % (d.getVar('FILE'), pkg))
python __anonymous() {
update_useradd_after_parse(d)