Mercurial > hg
changeset 14218:202ff575d49b
patch: fix clash between local variable and exception instance
The local err variable would be bound to PatchError thrown and it
keeps this value even after the except block is executed.
The whole thing worked anyway since the rejected variable is set in
the except block and this makes the function return -1 when a
PatchError is thrown.
author | Martin Geisler <mg@aragost.com> |
---|---|
date | Fri, 06 May 2011 11:31:40 +0200 |
parents | 71d5287351e9 |
children | c33427080671 |
files | mercurial/patch.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/patch.py Fri May 06 11:12:55 2011 +0200 +++ b/mercurial/patch.py Fri May 06 11:31:40 2011 +0200 @@ -1132,8 +1132,8 @@ first_hunk, strip) current_file = patcher(ui, current_file, opener, missing=missing, eolmode=eolmode) - except PatchError, err: - ui.warn(str(err) + '\n') + except PatchError, inst: + ui.warn(str(inst) + '\n') current_file = None rejects += 1 continue