Patchwork util: don't capture exception with a name since we don't use it

login
register
mail settings
Submitter Augie Fackler
Date Jan. 13, 2016, 7:46 p.m.
Message ID <6e0789a75a2d356a52a3.1452714404@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/12752/
State Accepted
Headers show

Comments

Augie Fackler - Jan. 13, 2016, 7:46 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1452714070 18000
#      Wed Jan 13 14:41:10 2016 -0500
# Node ID 6e0789a75a2d356a52a356531cb3222637b53993
# Parent  a171ecd0c8a4cebb4b57377073f03aef49713d6c
util: don't capture exception with a name since we don't use it

Spotted by pyflakes.
Martin von Zweigbergk - Jan. 14, 2016, 4:56 a.m.
Thanks. Pushed to the clowncopter.

On Wed, Jan 13, 2016 at 11:47 AM Augie Fackler <raf@durin42.com> wrote:

> # HG changeset patch
> # User Augie Fackler <augie@google.com>
> # Date 1452714070 18000
> #      Wed Jan 13 14:41:10 2016 -0500
> # Node ID 6e0789a75a2d356a52a356531cb3222637b53993
> # Parent  a171ecd0c8a4cebb4b57377073f03aef49713d6c
> util: don't capture exception with a name since we don't use it
>
> Spotted by pyflakes.
>
> diff --git a/mercurial/util.py b/mercurial/util.py
> --- a/mercurial/util.py
> +++ b/mercurial/util.py
> @@ -2693,7 +2693,7 @@ class ctxmanager(object):
>                      exc_type = None
>                      exc_val = None
>                      exc_tb = None
> -            except BaseException as e:
> +            except BaseException:
>                  pending = sys.exc_info()
>                  exc_type, exc_val, exc_tb = pending = sys.exc_info()
>          del self._atexit
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel
>

Patch

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -2693,7 +2693,7 @@  class ctxmanager(object):
                     exc_type = None
                     exc_val = None
                     exc_tb = None
-            except BaseException as e:
+            except BaseException:
                 pending = sys.exc_info()
                 exc_type, exc_val, exc_tb = pending = sys.exc_info()
         del self._atexit