[PATCH] windows: eliminate win32 wildcard import

Adrian Buehlmann adrian at cadifra.com
Thu Jul 28 14:18:25 CDT 2011


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1311880261 -7200
# Node ID 2277814690e8ea58c041b604d1e6a27f47d18ae8
# Parent  d78b92353f2693f206d350895ac73f1577e79f1c
windows: eliminate win32 wildcard import

diff --git a/mercurial/windows.py b/mercurial/windows.py
--- a/mercurial/windows.py
+++ b/mercurial/windows.py
@@ -6,9 +6,24 @@
 # GNU General Public License version 2 or any later version.
 
 from i18n import _
-import osutil
+import osutil, win32
 import errno, msvcrt, os, re, sys
 
+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
 
@@ -284,8 +299,6 @@
 def isexec(f):
     return False
 
-from win32 import *
-
 class cachestat(object):
     def __init__(self, path):
         pass
diff --git a/tests/test-check-pyflakes.t b/tests/test-check-pyflakes.t
--- a/tests/test-check-pyflakes.t
+++ b/tests/test-check-pyflakes.t
@@ -7,6 +7,5 @@
   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)
-  mercurial/windows.py:*: 'from win32 import *' used; unable to detect undefined names (glob)
   
 


More information about the Mercurial-devel mailing list