pyflakes: clean up some import noise
authorMatt Mackall <mpm@selenic.com>
Tue, 11 Oct 2011 23:16:05 -0500
changeset 15223 fc035e5370ca
parent 15222 73015301db86
child 15224 7c604d8c7e83
pyflakes: clean up some import noise
mercurial/commands.py
mercurial/hgweb/server.py
tests/test-check-pyflakes.t
--- 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)