[PATCH] test-check-pyflakes.t: don't check mercurial/windows.py

Matt Mackall mpm at selenic.com
Wed Aug 3 16:42:46 CDT 2011


On Mon, 2011-08-01 at 22:35 +0200, Adrian Buehlmann wrote:
> # HG changeset patch
> # User Adrian Buehlmann <adrian at cadifra.com>
> # Date 1312230849 -7200
> # Node ID 87070e3cd5f0407ba2a904d2927888e056ecf0ab
> # Parent  a31b8e03af28c5c8c7f2c2c8aa935d85561dd2bb
> test-check-pyflakes.t: don't check mercurial/windows.py
> 
> This file generates a lot "imported but unused" warnings, due to a long list
> of "from win32 import ..".

I've instead queued this:

# HG changeset patch
# User Matt Mackall <mpm at selenic.com>
# Date 1312407674 18000
# Node ID 871c77e78f5d6897778cea75a4fca6f19e979c85
# Parent  ee6988aea74efd76bdcd6a3e597cdb9d38bf678e
windows: fix pyflakes warning on unused imports

This is ugly, but only marginally uglier than before, and it avoids
hacking/disabling our pyflakes test

diff -r ee6988aea74e -r 871c77e78f5d mercurial/windows.py
--- a/mercurial/windows.py	Tue Aug 02 17:43:20 2011 -0500
+++ b/mercurial/windows.py	Wed Aug 03 16:41:14 2011 -0500
@@ -9,20 +9,21 @@
 import osutil
 import errno, msvcrt, os, re, sys
 
-from win32 import executablepath
-from win32 import getuser
-from win32 import hidewindow
-from win32 import lookupreg
-from win32 import makedir
-from win32 import nlinks
-from win32 import oslink
-from win32 import samedevice
-from win32 import samefile
-from win32 import setsignalhandler
-from win32 import spawndetached
-from win32 import termwidth
-from win32 import testpid
-from win32 import unlink
+import win32
+executablepath = win32.executablepath
+getuser = win32.getuser
+hidewindow = win32.hidewindow
+lookupreg = win32.lookupreg
+makedir = win32.makedir
+nlinks = win32.nlinks
+oslink = win32.oslink
+samedevice = win32.samedevice
+samefile = win32.samefile
+setsignalhandler = win32.setsignalhandler
+spawndetached = win32.spawndetached
+termwidth = win32.termwidth
+testpid = win32.testpid
+unlink = win32.unlink
 
 nulldev = 'NUL:'
 umask = 002


-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list