Patchwork [04/15] classes: Use modern exception raising syntax

login
register
mail settings
Submitter Richard Purdie
Date May 7, 2013, 12:55 p.m.
Message ID <1367931368-21504-4-git-send-email-richard.purdie@linuxfoundation.org>
Download mbox | patch
Permalink /patch/49441/
State New
Headers show

Comments

Richard Purdie - May 7, 2013, 12:55 p.m.
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>
---
 meta/classes/gtk-immodules-cache.bbclass |    2 +-
 meta/classes/update-alternatives.bbclass |    4 ++--
 meta/classes/update-rc.d.bbclass         |    4 ++--
 meta/classes/useradd.bbclass             |    4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

Patch

diff --git a/meta/classes/gtk-immodules-cache.bbclass b/meta/classes/gtk-immodules-cache.bbclass
index ed3069d..e11ed22 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/update-alternatives.bbclass b/meta/classes/update-alternatives.bbclass
index 45f4291..2cadaf7 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 d8cc342..5588569 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 0a4feba..52c0ba4 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)