[PATCH 1 of 3] cleanup: drop unused variables and an unused import

Kevin Bullock kbullock+mercurial at ringworld.org
Sat Jun 29 14:45:35 CDT 2013


On 26 Jun 2013, at 4:34 PM, Simon Heimberg wrote:

> # HG changeset patch
> # User Simon Heimberg <simohe at besonet.ch>
> # Date 1372280806 -7200
> # Node ID 2903c22bb19627574177c38d281e37111ef6a564
> # Parent  0d94e066ba6fa2a88eeed81033e694132f14be6a
> cleanup: drop unused variables and an unused import
> 
> found by running pyflakes
> 
> diff -r 0d94e066ba6f -r 2903c22bb196 contrib/casesmash.py
> --- a/contrib/casesmash.py	Die Jun 25 02:11:07 2013 +0200
> +++ b/contrib/casesmash.py	Mit Jun 26 23:06:46 2013 +0200
> @@ -7,7 +7,7 @@
>         d, base = os.path.split(fname)
>         try:
>             files = os.listdir(d or '.')
> -        except OSError, inst:
> +        except OSError:
>             files = []
>         if base in files:
>             return f(fname, *args, **kwargs)
> diff -r 0d94e066ba6f -r 2903c22bb196 contrib/check-code.py
> --- a/contrib/check-code.py	Die Jun 25 02:11:07 2013 +0200
> +++ b/contrib/check-code.py	Mit Jun 26 23:06:46 2013 +0200
> @@ -337,13 +337,14 @@
>         for pats in failandwarn:
>             for i, pseq in enumerate(pats):
>                 # fix-up regexes for multi-line searches
> -                po = p = pseq[0]
> +                p = pseq[0]
> +                #print p,
>                 # \s doesn't match \n
>                 p = re.sub(r'(?<!\\)\\s', r'[ \\t]', p)
>                 # [^...] doesn't match newline
>                 p = re.sub(r'(?<!\\)\[\^', r'[^\\n', p)
> 
> -                #print po, '=>', p
> +                #print '=>', p

Ugh, can we just drop these commented-out lines? We certainly shouldn't be introducing _more_ of them.

Looks good otherwise.

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock



More information about the Mercurial-devel mailing list