/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/patches.py

  • Committer: Jelmer Vernooij
  • Date: 2017-02-05 15:38:26 UTC
  • mto: (6621.2.1 py3)
  • mto: This revision was merged to the branch mainline in revision 6624.
  • Revision ID: jelmer@jelmer.uk-20170205153826-rnrd0m3iqoizqvrw
Apply 2to3 except fix.

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
        raise MalformedHunkHeader("Does not match format.", line)
82
82
    try:
83
83
        (orig, mod) = matches.group(1).split(" ")
84
 
    except (ValueError, IndexError), e:
 
84
    except (ValueError, IndexError) as e:
85
85
        raise MalformedHunkHeader(str(e), line)
86
86
    if not orig.startswith('-') or not mod.startswith('+'):
87
87
        raise MalformedHunkHeader("Positions don't start with + or -.", line)
88
88
    try:
89
89
        (orig_pos, orig_range) = parse_range(orig[1:])
90
90
        (mod_pos, mod_range) = parse_range(mod[1:])
91
 
    except (ValueError, IndexError), e:
 
91
    except (ValueError, IndexError) as e:
92
92
        raise MalformedHunkHeader(str(e), line)
93
93
    if mod_range < 0 or orig_range < 0:
94
94
        raise MalformedHunkHeader("Hunk range is negative", line)
327
327
    iter_lines = iter_lines_handle_nl(iter_lines)
328
328
    try:
329
329
        (orig_name, mod_name) = get_patch_names(iter_lines)
330
 
    except BinaryFiles, e:
 
330
    except BinaryFiles as e:
331
331
        return BinaryPatch(e.orig_name, e.mod_name)
332
332
    else:
333
333
        patch = Patch(orig_name, mod_name)