From 578786c38b65e5c3925ab9f605cfd661d0950cc2 Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Wed, 14 Feb 2018 11:19:49 +1300 Subject: buildtools python: convert 'except X, e' to 'except X as e' Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Thu Feb 15 05:40:55 CET 2018 on sn-devel-144 --- buildtools/wafsamba/nothreads.py | 4 ++-- buildtools/wafsamba/samba_conftests.py | 2 +- buildtools/wafsamba/samba_dist.py | 2 +- buildtools/wafsamba/wafsamba.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'buildtools') diff --git a/buildtools/wafsamba/nothreads.py b/buildtools/wafsamba/nothreads.py index d194eb88a21..9bd33e89f8d 100644 --- a/buildtools/wafsamba/nothreads.py +++ b/buildtools/wafsamba/nothreads.py @@ -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 diff --git a/buildtools/wafsamba/samba_conftests.py b/buildtools/wafsamba/samba_conftests.py index 511176d8e7b..b52727b0845 100644 --- a/buildtools/wafsamba/samba_conftests.py +++ b/buildtools/wafsamba/samba_conftests.py @@ -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: diff --git a/buildtools/wafsamba/samba_dist.py b/buildtools/wafsamba/samba_dist.py index 2e52820697b..8d516320a25 100644 --- a/buildtools/wafsamba/samba_dist.py +++ b/buildtools/wafsamba/samba_dist.py @@ -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) diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py index 4bb19d070e2..1e331e5fcb3 100644 --- a/buildtools/wafsamba/wafsamba.py +++ b/buildtools/wafsamba/wafsamba.py @@ -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 -- cgit v1.2.1