[gnome-continuous-yocto/gnomeostree-3.28-rocko: 287/8267] wic: use new syntax of 'except' statement



commit e301be3cd09499e605fb204fc4f197eca11f9305
Author: Ed Bartosh <ed bartosh linux intel com>
Date:   Wed May 4 16:06:19 2016 +0300

    wic: use new syntax of 'except' statement
    
    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]
    
    (From OE-Core rev: 15e88714d6b0a93f72e8a19b083fcc1f2006e128)
    
    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 |    2 +-
 scripts/lib/wic/plugin.py        |    2 +-
 scripts/lib/wic/utils/runner.py  |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/scripts/lib/wic/imager/direct.py b/scripts/lib/wic/imager/direct.py
index 319ec16..5a3b655 100644
--- a/scripts/lib/wic/imager/direct.py
+++ b/scripts/lib/wic/imager/direct.py
@@ -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)
 
diff --git a/scripts/lib/wic/plugin.py b/scripts/lib/wic/plugin.py
index 83af9b0..dcbaa08 100644
--- a/scripts/lib/wic/plugin.py
+++ b/scripts/lib/wic/plugin.py
@@ -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)
diff --git a/scripts/lib/wic/utils/runner.py b/scripts/lib/wic/utils/runner.py
index 7431917..737751b 100644
--- a/scripts/lib/wic/utils/runner.py
+++ b/scripts/lib/wic/utils/runner.py
@@ -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)


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