diff options
author | Guido Günther <agx@sigxcpu.org> | 2012-07-02 08:05:06 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2012-07-02 08:53:04 +0200 |
commit | e6e0150e07be32b91624b460b67be39b8f6b0ab9 (patch) | |
tree | ebf593199d58f8a46d3bbeae3335258c6e264d54 /gbp/scripts/pq.py | |
parent | 92a744e5c8e9751f7336ddaac597ded2a7456d8f (diff) | |
download | git-buildpackage-e6e0150e07be32b91624b460b67be39b8f6b0ab9.tar.gz git-buildpackage-e6e0150e07be32b91624b460b67be39b8f6b0ab9.tar.bz2 git-buildpackage-e6e0150e07be32b91624b460b67be39b8f6b0ab9.zip |
Make exception syntax consistent
Diffstat (limited to 'gbp/scripts/pq.py')
-rwxr-xr-x | gbp/scripts/pq.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gbp/scripts/pq.py b/gbp/scripts/pq.py index 2fcc0c83..44b88192 100755 --- a/gbp/scripts/pq.py +++ b/gbp/scripts/pq.py @@ -49,9 +49,9 @@ def export_patches(repo, branch, options): pq_branch = pq_branch_name(branch) try: shutil.rmtree(PATCH_DIR) - except OSError, (e, msg): + except OSError as (e, msg): if e != errno.ENOENT: - raise GbpError, "Failed to remove patch dir: %s" % msg + raise GbpError("Failed to remove patch dir: %s" % msg) else: gbp.log.debug("%s does not exist." % PATCH_DIR) @@ -122,8 +122,8 @@ def import_quilt_patches(repo, branch, series, tries, force): if force: drop_pq(repo, branch) else: - raise GbpError, ("Patch queue branch '%s'. already exists. Try 'rebase' instead." - % pq_branch) + raise GbpError("Patch queue branch '%s'. already exists. Try 'rebase' instead." + % pq_branch) commits = repo.get_commits(num=tries, first_parent=True) # If we go back in history we have to safe our pq so we always try to apply @@ -137,7 +137,7 @@ def import_quilt_patches(repo, branch, series, tries, force): gbp.log.info("Trying to apply patches at '%s'" % commit) repo.create_branch(pq_branch, commit) except CommandExecFailed: - raise GbpError, ("Cannot create patch-queue branch '%s'." % pq_branch) + raise GbpError("Cannot create patch-queue branch '%s'." % pq_branch) repo.set_branch(pq_branch) for patch in queue: @@ -152,7 +152,7 @@ def import_quilt_patches(repo, branch, series, tries, force): # All patches applied successfully break else: - raise GbpError, "Couldn't apply patches" + raise GbpError("Couldn't apply patches") if tmpdir: gbp.log.debug("Remove temporary patch safe '%s'" % tmpdir) @@ -251,7 +251,7 @@ def main(argv): switch_pq(repo, current) except CommandExecFailed: retval = 1 - except GbpError, err: + except GbpError as err: if len(err.__str__()): gbp.log.err(err) retval = 1 |