changeset 15223:fc035e5370ca

pyflakes: clean up some import noise
author Matt Mackall <mpm@selenic.com>
date Tue, 11 Oct 2011 23:16:05 -0500
parents 73015301db86
children 7c604d8c7e83
files mercurial/commands.py mercurial/hgweb/server.py tests/test-check-pyflakes.t
diffstat 3 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Tue Oct 11 20:21:13 2011 -0500
+++ b/mercurial/commands.py	Tue Oct 11 23:16:05 2011 -0500
@@ -1852,6 +1852,7 @@
               % os.path.dirname(__file__))
     try:
         import bdiff, mpatch, base85, osutil
+        dir(bdiff), dir(mpatch), dir(base85), dir(osutil) # quiet pyflakes
     except Exception, inst:
         ui.write(" %s\n" % inst)
         ui.write(_(" One or more extensions could not be found"))
--- a/mercurial/hgweb/server.py	Tue Oct 11 20:21:13 2011 -0500
+++ b/mercurial/hgweb/server.py	Tue Oct 11 23:16:05 2011 -0500
@@ -246,6 +246,7 @@
 
 try:
     from threading import activeCount
+    activeCount() # silence pyflakes
     _mixin = SocketServer.ThreadingMixIn
 except ImportError:
     if util.safehasattr(os, "fork"):
--- a/tests/test-check-pyflakes.t	Tue Oct 11 20:21:13 2011 -0500
+++ b/tests/test-check-pyflakes.t	Tue Oct 11 23:16:05 2011 -0500
@@ -1,11 +1,6 @@
   $ "$TESTDIR/hghave" pyflakes || exit 80
   $ cd $(dirname $TESTDIR)
   $ pyflakes mercurial hgext 2>&1 | $TESTDIR/filterpyflakes.py
-  mercurial/hgweb/server.py:*: 'activeCount' imported but unused (glob)
-  mercurial/commands.py:*: 'base85' imported but unused (glob)
-  mercurial/commands.py:*: 'bdiff' imported but unused (glob)
-  mercurial/commands.py:*: 'mpatch' imported but unused (glob)
-  mercurial/commands.py:*: 'osutil' imported but unused (glob)
   hgext/inotify/linux/__init__.py:*: 'from _inotify import *' used; unable to detect undefined names (glob)