summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-21 12:29:16 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-21 22:26:33 +0100
commit3ddde5f32afe9225994df607f6b8dfcc58f6bdc7 (patch)
tree852bf239ca9347f8c78b3f1ccc7433f8ba36517d
parent01d07f328fb2644169eda5dbffaf2b6117696959 (diff)
downloadpoky-3ddde5f32afe9225994df607f6b8dfcc58f6bdc7.tar.gz
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>
-rw-r--r--meta/classes/base.bbclass2
-rw-r--r--meta/classes/utility-tasks.bbclass2
-rw-r--r--meta/lib/oe/data.py2
-rw-r--r--meta/lib/oe/prservice.py2
-rw-r--r--meta/lib/oe/utils.py2
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py4
-rw-r--r--meta/lib/oeqa/utils/qemutinyrunner.py2
7 files changed, 8 insertions, 8 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index c3c2669939..4be0a7e487 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -661,7 +661,7 @@ python do_cleanall() {
661 try: 661 try:
662 fetcher = bb.fetch2.Fetch(src_uri, d) 662 fetcher = bb.fetch2.Fetch(src_uri, d)
663 fetcher.clean() 663 fetcher.clean()
664 except bb.fetch2.BBFetchException, e: 664 except bb.fetch2.BBFetchException as e:
665 raise bb.build.FuncFailed(e) 665 raise bb.build.FuncFailed(e)
666} 666}
667do_cleanall[nostamp] = "1" 667do_cleanall[nostamp] = "1"
diff --git a/meta/classes/utility-tasks.bbclass b/meta/classes/utility-tasks.bbclass
index 5bcfd0b72c..7bc584abb9 100644
--- a/meta/classes/utility-tasks.bbclass
+++ b/meta/classes/utility-tasks.bbclass
@@ -46,7 +46,7 @@ python do_checkuri() {
46 try: 46 try:
47 fetcher = bb.fetch2.Fetch(src_uri, d) 47 fetcher = bb.fetch2.Fetch(src_uri, d)
48 fetcher.checkstatus() 48 fetcher.checkstatus()
49 except bb.fetch2.BBFetchException, e: 49 except bb.fetch2.BBFetchException as e:
50 raise bb.build.FuncFailed(e) 50 raise bb.build.FuncFailed(e)
51} 51}
52 52
diff --git a/meta/lib/oe/data.py b/meta/lib/oe/data.py
index e49572177b..23a9067a60 100644
--- a/meta/lib/oe/data.py
+++ b/meta/lib/oe/data.py
@@ -13,5 +13,5 @@ def typed_value(key, d):
13 13
14 try: 14 try:
15 return oe.maketype.create(d.getVar(key, True) or '', var_type, **flags) 15 return oe.maketype.create(d.getVar(key, True) or '', var_type, **flags)
16 except (TypeError, ValueError), exc: 16 except (TypeError, ValueError) as exc:
17 bb.msg.fatal("Data", "%s: %s" % (key, str(exc))) 17 bb.msg.fatal("Data", "%s: %s" % (key, str(exc)))
diff --git a/meta/lib/oe/prservice.py b/meta/lib/oe/prservice.py
index b0cbcb1fbc..9e5a0c9830 100644
--- a/meta/lib/oe/prservice.py
+++ b/meta/lib/oe/prservice.py
@@ -9,7 +9,7 @@ def prserv_make_conn(d, check = False):
9 if not conn.ping(): 9 if not conn.ping():
10 raise Exception('service not available') 10 raise Exception('service not available')
11 d.setVar("__PRSERV_CONN",conn) 11 d.setVar("__PRSERV_CONN",conn)
12 except Exception, exc: 12 except Exception as exc:
13 bb.fatal("Connecting to PR service %s:%s failed: %s" % (host_params[0], host_params[1], str(exc))) 13 bb.fatal("Connecting to PR service %s:%s failed: %s" % (host_params[0], host_params[1], str(exc)))
14 14
15 return conn 15 return conn
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index d1dfbfb95d..32d61794ee 100644
--- a/meta/lib/oe/utils.py
+++ b/meta/lib/oe/utils.py
@@ -264,7 +264,7 @@ class ThreadedWorker(Thread):
264 264
265 try: 265 try:
266 func(self, *args, **kargs) 266 func(self, *args, **kargs)
267 except Exception, e: 267 except Exception as e:
268 print(e) 268 print(e)
269 finally: 269 finally:
270 self.tasks.task_done() 270 self.tasks.task_done()
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 4bede3421c..695402fead 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -114,7 +114,7 @@ class QemuRunner:
114 try: 114 try:
115 threadsock, threadport = self.create_socket() 115 threadsock, threadport = self.create_socket()
116 self.server_socket, self.serverport = self.create_socket() 116 self.server_socket, self.serverport = self.create_socket()
117 except socket.error, msg: 117 except socket.error as msg:
118 logger.error("Failed to create listening socket: %s" % msg[1]) 118 logger.error("Failed to create listening socket: %s" % msg[1])
119 return False 119 return False
120 120
@@ -192,7 +192,7 @@ class QemuRunner:
192 else: 192 else:
193 self.ip = ips[0] 193 self.ip = ips[0]
194 self.server_ip = ips[1] 194 self.server_ip = ips[1]
195 except IndexError, ValueError: 195 except (IndexError, ValueError):
196 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))) 196 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)))
197 self._dump_host() 197 self._dump_host()
198 self.stop() 198 self.stop()
diff --git a/meta/lib/oeqa/utils/qemutinyrunner.py b/meta/lib/oeqa/utils/qemutinyrunner.py
index e3d8c669e0..d6ce09645c 100644
--- a/meta/lib/oeqa/utils/qemutinyrunner.py
+++ b/meta/lib/oeqa/utils/qemutinyrunner.py
@@ -50,7 +50,7 @@ class QemuTinyRunner(QemuRunner):
50 self.server_socket.connect(self.socketfile) 50 self.server_socket.connect(self.socketfile)
51 bb.note("Created listening socket for qemu serial console.") 51 bb.note("Created listening socket for qemu serial console.")
52 tries = 0 52 tries = 0
53 except socket.error, msg: 53 except socket.error as msg:
54 self.server_socket.close() 54 self.server_socket.close()
55 bb.fatal("Failed to create listening socket.") 55 bb.fatal("Failed to create listening socket.")
56 tries -= 1 56 tries -= 1