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

login
register
mail settings
Submitter Simon Heimberg
Date June 26, 2013, 9:34 p.m.
Message ID <2903c22bb19627574177.1372282499@lapsi.heimberg.home>
Download mbox | patch
Permalink /patch/1752/
State Superseded
Commit 9de689d20230ffdc0c6b233cf0c0d756c8521c7f
Headers show

Comments

Simon Heimberg - June 26, 2013, 9:34 p.m.
# HG changeset patch
# User Simon Heimberg <simohe@besonet.ch>
# Date 1372280806 -7200
# Node ID 2903c22bb19627574177c38d281e37111ef6a564
# Parent  0d94e066ba6fa2a88eeed81033e694132f14be6a
cleanup: drop unused variables and an unused import

found by running pyflakes

Patch

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
                 pats[i] = (re.compile(p, re.MULTILINE),) + pseq[1:]
         filters = c[2]
         for i, flt in enumerate(filters):
diff -r 0d94e066ba6f -r 2903c22bb196 contrib/hgfixes/fix_leftover_imports.py
--- a/contrib/hgfixes/fix_leftover_imports.py	Die Jun 25 02:11:07 2013 +0200
+++ b/contrib/hgfixes/fix_leftover_imports.py	Mit Jun 26 23:06:46 2013 +0200
@@ -48,7 +48,6 @@ 
     mod_list = ' | '.join(["'%s' '.' ('%s')" %
         (key, "' | '".join(packages[key])) for key in packages])
     mod_list = '(' + mod_list + ' )'
-    bare_names = alternates(mapping.keys())
 
     yield """name_import=import_name< 'import' module_name=dotted_name< %s > >
           """ % mod_list
diff -r 0d94e066ba6f -r 2903c22bb196 contrib/perf.py
--- a/contrib/perf.py	Die Jun 25 02:11:07 2013 +0200
+++ b/contrib/perf.py	Mit Jun 26 23:06:46 2013 +0200
@@ -175,7 +175,7 @@ 
 def perfmanifest(ui, repo):
     def d():
         t = repo.manifest.tip()
-        m = repo.manifest.read(t)
+        repo.manifest.read(t)
         repo.manifest.mapcache = None
         repo.manifest._cache = None
     timer(d)
@@ -184,7 +184,7 @@ 
 def perfchangeset(ui, repo, rev):
     n = repo[rev].node()
     def d():
-        c = repo.changelog.read(n)
+        repo.changelog.read(n)
         #repo.changelog._cache = None
     timer(d)
 
diff -r 0d94e066ba6f -r 2903c22bb196 contrib/simplemerge
--- a/contrib/simplemerge	Die Jun 25 02:11:07 2013 +0200
+++ b/contrib/simplemerge	Mit Jun 26 23:06:46 2013 +0200
@@ -3,7 +3,7 @@ 
 from mercurial import demandimport
 demandimport.enable()
 
-import os, sys
+import sys
 from mercurial.i18n import _
 from mercurial import simplemerge, fancyopts, util, ui
 
diff -r 0d94e066ba6f -r 2903c22bb196 doc/hgmanpage.py
--- a/doc/hgmanpage.py	Die Jun 25 02:11:07 2013 +0200
+++ b/doc/hgmanpage.py	Mit Jun 26 23:06:46 2013 +0200
@@ -981,7 +981,6 @@ 
         #    Level is too low to display:
         #    raise nodes.SkipNode
         attr = {}
-        backref_text = ''
         if node.hasattr('id'):
             attr['name'] = node['id']
         if node.hasattr('line'):
diff -r 0d94e066ba6f -r 2903c22bb196 tests/hghave.py
--- a/tests/hghave.py	Die Jun 25 02:11:07 2013 +0200
+++ b/tests/hghave.py	Mit Jun 26 23:06:46 2013 +0200
@@ -105,7 +105,7 @@ 
     sock = socket.socket(socket.AF_UNIX)
     try:
         sock.bind(name)
-    except socket.error, err:
+    except socket.error:
         return False
     sock.close()
     os.unlink(name)
diff -r 0d94e066ba6f -r 2903c22bb196 tests/test-hgweb-auth.py
--- a/tests/test-hgweb-auth.py	Die Jun 25 02:11:07 2013 +0200
+++ b/tests/test-hgweb-auth.py	Mit Jun 26 23:06:46 2013 +0200
@@ -41,7 +41,7 @@ 
             if authinfo is not None:
                 pm.add_password(*authinfo)
             print '    ', pm.find_user_password('test', u)
-        except Abort, e:
+        except Abort:
             print 'abort'
 
     if not urls: