[PATCH 2 of 3 RFC] current failings for "redefinition of unused"

Matt Mackall mpm at selenic.com
Tue May 3 15:46:52 CDT 2011


On Sun, 2011-05-01 at 14:17 -0500, timeless wrote:
> # HG changeset patch
> # User timeless <timeless at mozdev.org>
> # Date 1304276739 -7200
> # Node ID d4ae94b08329cba945c387014583238217765807
> # Parent  43e7814696adbe3e32cba0f2f6b479b8ac43a638
> current failings for "redefinition of unused"
> 
> diff --git a/tests/filterpyflakes.py b/tests/filterpyflakes.py
> --- a/tests/filterpyflakes.py
> +++ b/tests/filterpyflakes.py
> @@ -23,6 +23,7 @@ for line in sys.stdin:
>              r"local variable '.*' is assigned to but never used",
>              r"unable to detect undefined names",
>              r"redefinition of function",
> +            r"redefinition of unused",
>             ]
>      if not re.search('|'.join(pats), line):
>          continue
> diff --git a/tests/test-check-pyflakes.t b/tests/test-check-pyflakes.t
> --- a/tests/test-check-pyflakes.t
> +++ b/tests/test-check-pyflakes.t
> @@ -29,5 +29,22 @@
>    mercurial/scmutil.py:*: redefinition of function 'system_rcpath' from line * (glob)
>    mercurial/scmutil.py:*: redefinition of function 'user_rcpath' from line * (glob)
>    mercurial/cmdutil.py:*: redefinition of function 'want' from line * (glob)
> +  hgext/convert/darcs.py:*: redefinition of unused 'ElementTree' from line * (glob)
> +  hgext/convert/darcs.py:*: redefinition of unused 'ElementTree' from line * (glob)
> +  hgext/convert/darcs.py:*: redefinition of unused 'ElementTree' from line * (glob)
> +  hgext/convert/darcs.py:*: redefinition of unused 'ElementTree' from line * (glob)
> +  mercurial/pure/mpatch.py:*: redefinition of unused 'StringIO' from line * (glob)
> +  hgext/convert/darcs.py:*: redefinition of unused 'XMLParser' from line * (glob)
> +  hgext/convert/darcs.py:*: redefinition of unused 'XMLParser' from line * (glob)
> +  hgext/convert/darcs.py:*: redefinition of unused 'XMLParser' from line * (glob)
> +  mercurial/keepalive.py:*: redefinition of unused '_md*' from line * (glob)
> +  mercurial/util.py:*: redefinition of unused '_sha*' from line * (glob)
> +  hgext/convert/subversion.py:*: redefinition of unused 'commit' from line * (glob)
> +  mercurial/commands.py:*: redefinition of unused 'copies' from line * (glob)
> +  mercurial/byterange.py:*: redefinition of unused 'email' from line * (glob)
> +  mercurial/byterange.py:*: redefinition of unused 'mimetypes' from line * (glob)
> +  mercurial/context.py:*: redefinition of unused 'stat' from line * (glob)
> +  hgext/convert/subversion.py:*: redefinition of unused 'svn' from line * (glob)
> +  mercurial/keepalive.py:*: redefinition of unused 'time' from line * (glob)

This trips on stuff like:

try:
    from cStringIO import StringIO
except ImportError:
    from StringIO import StringIO

..which is a perfectly sensible way to do a compatibility fallback. So I
think I have to NAK this one too.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list