buildtools python: convert 'except X, e' to 'except X as e'
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Tue, 13 Feb 2018 22:19:49 +0000 (11:19 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 15 Feb 2018 04:40:55 +0000 (05:40 +0100)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Feb 15 05:40:55 CET 2018 on sn-devel-144

buildtools/wafsamba/nothreads.py
buildtools/wafsamba/samba_conftests.py
buildtools/wafsamba/samba_dist.py
buildtools/wafsamba/wafsamba.py

index d194eb88a21bb79517f8caa8b714195ac88fca54..9bd33e89f8d035c60f6915694565e28660e05951 100644 (file)
@@ -43,7 +43,7 @@ def process(tsk):
         if tsk.__class__.stat: ret = tsk.__class__.stat(tsk)
         # actual call to task's run() function
         else: ret = tsk.call_run()
-    except Exception, e:
+    except Exception as e:
         tsk.err_msg = Utils.ex_stack()
         tsk.hasrun = EXCEPTION
 
@@ -177,7 +177,7 @@ class Parallel(object):
 
             try:
                 st = tsk.runnable_status()
-            except Exception, e:
+            except Exception as e:
                 self.processed += 1
                 if self.stop and not Options.options.keep:
                     tsk.hasrun = SKIPPED
index 511176d8e7bce459de384cd500fdf9111811008f..b52727b0845d0a57f0bda43124f665b6d1d37bf7 100644 (file)
@@ -50,7 +50,7 @@ def check(self, *k, **kw):
     ret = None
     try:
         ret = self.run_c_code(*k, **kw)
-    except Configure.ConfigurationError, e:
+    except Configure.ConfigurationError as e:
         self.check_message_2(kw['errmsg'], 'YELLOW')
         if 'mandatory' in kw and kw['mandatory']:
             if Logs.verbose > 1:
index 2e52820697b39872c51acd0179575a9f14cff95e..8d516320a251ddaf122c390f00c6f1abf59cecaa 100644 (file)
@@ -167,7 +167,7 @@ def dist(appname='', version=''):
         absdir = os.path.join(srcdir, dir)
         try:
             files = vcs_dir_contents(absdir)
-        except Exception, e:
+        except Exception as e:
             Logs.error('unable to get contents of %s: %s' % (absdir, e))
             sys.exit(1)
         add_files_to_tarball(tar, srcdir, dir, dist_base, destdir, blacklist, files)
index 4bb19d070e227390dd7156c19b5a3f5dca6f3a43..1e331e5fcb38d8814a44ccfc4f5f376af757d28f 100644 (file)
@@ -900,7 +900,7 @@ def INSTALL_DIR(bld, path, chmod=0o755, env=None):
             try:
                 os.makedirs(destpath)
                 os.chmod(destpath, chmod)
-            except OSError, e:
+            except OSError as e:
                 if not os.path.isdir(destpath):
                     raise Utils.WafError("Cannot create the folder '%s' (error: %s)" % (path, e))
 Build.BuildContext.INSTALL_DIR = INSTALL_DIR