[gnome-continuous-yocto/gnomeostree-3.28-rocko: 464/8267] meta: Update to modern exception syntax



commit 3ddde5f32afe9225994df607f6b8dfcc58f6bdc7
Author: Richard Purdie <richard purdie linuxfoundation org>
Date:   Sat May 21 12:29:16 2016 +0100

    meta: Update to modern exception syntax
    
    Update older exception syntax to modern one required by python 3.
    Compatible with python 2.7.
    
    (From OE-Core rev: d13f0ac614f1d1e2ef2c8ddc71cbfcf76a8dc3f2)
    
    Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>

 meta/classes/base.bbclass             |    2 +-
 meta/classes/utility-tasks.bbclass    |    2 +-
 meta/lib/oe/data.py                   |    2 +-
 meta/lib/oe/prservice.py              |    2 +-
 meta/lib/oe/utils.py                  |    2 +-
 meta/lib/oeqa/utils/qemurunner.py     |    4 ++--
 meta/lib/oeqa/utils/qemutinyrunner.py |    2 +-
 7 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index c3c2669..4be0a7e 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -661,7 +661,7 @@ python do_cleanall() {
     try:
         fetcher = bb.fetch2.Fetch(src_uri, d)
         fetcher.clean()
-    except bb.fetch2.BBFetchException, e:
+    except bb.fetch2.BBFetchException as e:
         raise bb.build.FuncFailed(e)
 }
 do_cleanall[nostamp] = "1"
diff --git a/meta/classes/utility-tasks.bbclass b/meta/classes/utility-tasks.bbclass
index 5bcfd0b..7bc584a 100644
--- a/meta/classes/utility-tasks.bbclass
+++ b/meta/classes/utility-tasks.bbclass
@@ -46,7 +46,7 @@ python do_checkuri() {
     try:
         fetcher = bb.fetch2.Fetch(src_uri, d)
         fetcher.checkstatus()
-    except bb.fetch2.BBFetchException, e:
+    except bb.fetch2.BBFetchException as e:
         raise bb.build.FuncFailed(e)
 }
 
diff --git a/meta/lib/oe/data.py b/meta/lib/oe/data.py
index e495721..23a9067 100644
--- a/meta/lib/oe/data.py
+++ b/meta/lib/oe/data.py
@@ -13,5 +13,5 @@ def typed_value(key, d):
 
     try:
         return oe.maketype.create(d.getVar(key, True) or '', var_type, **flags)
-    except (TypeError, ValueError), exc:
+    except (TypeError, ValueError) as exc:
         bb.msg.fatal("Data", "%s: %s" % (key, str(exc)))
diff --git a/meta/lib/oe/prservice.py b/meta/lib/oe/prservice.py
index b0cbcb1..9e5a0c9 100644
--- a/meta/lib/oe/prservice.py
+++ b/meta/lib/oe/prservice.py
@@ -9,7 +9,7 @@ def prserv_make_conn(d, check = False):
             if not conn.ping():
                 raise Exception('service not available')
         d.setVar("__PRSERV_CONN",conn)
-    except Exception, exc:
+    except Exception as exc:
         bb.fatal("Connecting to PR service %s:%s failed: %s" % (host_params[0], host_params[1], str(exc)))
 
     return conn
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index d1dfbfb..32d6179 100644
--- a/meta/lib/oe/utils.py
+++ b/meta/lib/oe/utils.py
@@ -264,7 +264,7 @@ class ThreadedWorker(Thread):
 
             try:
                 func(self, *args, **kargs)
-            except Exception, e:
+            except Exception as e:
                 print(e)
             finally:
                 self.tasks.task_done()
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 4bede34..695402f 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -114,7 +114,7 @@ class QemuRunner:
         try:
             threadsock, threadport = self.create_socket()
             self.server_socket, self.serverport = self.create_socket()
-        except socket.error, msg:
+        except socket.error as msg:
             logger.error("Failed to create listening socket: %s" % msg[1])
             return False
 
@@ -192,7 +192,7 @@ class QemuRunner:
                     else:
                         self.ip = ips[0]
                         self.server_ip = ips[1]
-                except IndexError, ValueError:
+                except (IndexError, ValueError):
                     logger.info("Couldn't get ip from qemu process arguments! Here is the qemu command line 
used:\n%s\nand output from runqemu:\n%s" % (cmdline, self.getOutput(output)))
                     self._dump_host()
                     self.stop()
diff --git a/meta/lib/oeqa/utils/qemutinyrunner.py b/meta/lib/oeqa/utils/qemutinyrunner.py
index e3d8c66..d6ce096 100644
--- a/meta/lib/oeqa/utils/qemutinyrunner.py
+++ b/meta/lib/oeqa/utils/qemutinyrunner.py
@@ -50,7 +50,7 @@ class QemuTinyRunner(QemuRunner):
                 self.server_socket.connect(self.socketfile)
                 bb.note("Created listening socket for qemu serial console.")
                 tries = 0
-            except socket.error, msg:
+            except socket.error as msg:
                 self.server_socket.close()
                 bb.fatal("Failed to create listening socket.")
                 tries -= 1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]