[PATCH] windows: eliminate win32 wildcard import

Mads Kiilerich mads at kiilerich.com
Thu Jul 28 16:07:53 CDT 2011


Adrian Buehlmann wrote, On 07/28/2011 09:18 PM:
> # 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

Here I would use
   from win32 import executablepath, ...

/Mads


More information about the Mercurial-devel mailing list