]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: use new syntax of 'except' statement
authorEd Bartosh <ed.bartosh@linux.intel.com>
Wed, 4 May 2016 13:06:19 +0000 (16:06 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 14 May 2016 06:26:42 +0000 (07:26 +0100)
New syntax 'except Exception as err' is supported by Python >= 2.7.
Old syntax 'except Exception, err' is not supported by Python 3.

Used new syntax to be able to run wic on Python 3.

[YOCTO #9412]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/wic/imager/direct.py
scripts/lib/wic/plugin.py
scripts/lib/wic/utils/runner.py

index 319ec1654dcf34619bb3db123dff1025fe671747..5a3b655a0cec099728c1a09bff6fa1839cc00193 100644 (file)
@@ -395,6 +395,6 @@ class DirectImageCreator(BaseImageCreator):
         if not self.__image is None:
             try:
                 self.__image.cleanup()
-            except ImageError, err:
+            except ImageError as err:
                 msger.warning("%s" % err)
 
index 83af9b05dfccb1f9427b083d42865354464e80e7..dcbaa0855612fb542ff7b22104741ecf954409cf 100644 (file)
@@ -97,7 +97,7 @@ class PluginMgr():
                             self.plugin_dirs[pdir] = True
                             msger.debug("Plugin module %s:%s imported"\
                                         % (mod, pymod.__file__))
-                        except ImportError, err:
+                        except ImportError as err:
                             msg = 'Failed to load plugin %s/%s: %s' \
                                 % (os.path.basename(pdir), mod, err)
                             msger.warning(msg)
index 7431917ff042278b919a6e4f37253fdf49ead11a..737751bd73dff6bfa7c40430f172fb727a08a28e 100644 (file)
@@ -67,7 +67,7 @@ def runtool(cmdln_or_args, catch=1):
         (sout, serr) = process.communicate()
         # combine stdout and stderr, filter None out
         out = ''.join(filter(None, [sout, serr]))
-    except OSError, err:
+    except OSError as err:
         if err.errno == 2:
             # [Errno 2] No such file or directory
             msger.error('Cannot run command: %s, lost dependency?' % cmd)