diff options
author | Paul Burton <paul.burton@imgtec.com> | 2016-09-27 16:03:51 +0100 |
---|---|---|
committer | sjg <sjg@chromium.org> | 2016-10-09 09:30:32 -0600 |
commit | ac3fde9394ce90503930026c62ffd94bf7fa09fd (patch) | |
tree | ba4656e51f8ff8e318e688b2de629e73698a8e24 /tools/patman/gitutil.py | |
parent | a920a17b2f418535870788ae81234dc6b8aa6661 (diff) | |
download | u-boot-ac3fde9394ce90503930026c62ffd94bf7fa09fd.zip u-boot-ac3fde9394ce90503930026c62ffd94bf7fa09fd.tar.gz u-boot-ac3fde9394ce90503930026c62ffd94bf7fa09fd.tar.bz2 |
patman: Make exception handling python 3.x safe
Syntax for exception handling is a little more strict in python 3.x.
Convert all uses to a form accepted by both python 2.x & python 3.x.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/patman/gitutil.py')
-rw-r--r-- | tools/patman/gitutil.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py index c0fe093..0d23079 100644 --- a/tools/patman/gitutil.py +++ b/tools/patman/gitutil.py @@ -139,7 +139,7 @@ def GetUpstream(git_dir, branch): leaf = merge.split('/')[-1] return '%s/%s' % (remote, leaf), None else: - raise ValueError, ("Cannot determine upstream branch for branch " + raise ValueError("Cannot determine upstream branch for branch " "'%s' remote='%s', merge='%s'" % (branch, remote, merge)) @@ -224,7 +224,7 @@ def Checkout(commit_hash, git_dir=None, work_tree=None, force=False): result = command.RunPipe([pipe], capture=True, raise_on_error=False, capture_stderr=True) if result.return_code != 0: - raise OSError, 'git checkout (%s): %s' % (pipe, result.stderr) + raise OSError('git checkout (%s): %s' % (pipe, result.stderr)) def Clone(git_dir, output_dir): """Checkout the selected commit for this build @@ -236,7 +236,7 @@ def Clone(git_dir, output_dir): result = command.RunPipe([pipe], capture=True, cwd=output_dir, capture_stderr=True) if result.return_code != 0: - raise OSError, 'git clone: %s' % result.stderr + raise OSError('git clone: %s' % result.stderr) def Fetch(git_dir=None, work_tree=None): """Fetch from the origin repo @@ -252,7 +252,7 @@ def Fetch(git_dir=None, work_tree=None): pipe.append('fetch') result = command.RunPipe([pipe], capture=True, capture_stderr=True) if result.return_code != 0: - raise OSError, 'git fetch: %s' % result.stderr + raise OSError('git fetch: %s' % result.stderr) def CreatePatches(start, count, series): """Create a series of patches from the top of the current branch. @@ -489,7 +489,7 @@ def LookupEmail(lookup_name, alias=None, raise_on_error=True, level=0): if level > 10: msg = "Recursive email alias at '%s'" % lookup_name if raise_on_error: - raise OSError, msg + raise OSError(msg) else: print(col.Color(col.RED, msg)) return out_list @@ -498,7 +498,7 @@ def LookupEmail(lookup_name, alias=None, raise_on_error=True, level=0): if not lookup_name in alias: msg = "Alias '%s' not found" % lookup_name if raise_on_error: - raise ValueError, msg + raise ValueError(msg) else: print(col.Color(col.RED, msg)) return out_list |