Patchwork [1,of,2] import-checker: force 'ctype.util' to stdlib module

login
register
mail settings
Submitter Matt Harbison
Date Dec. 23, 2015, 4:22 a.m.
Message ID <8f83787abed009b037f0.1450844575@Envy>
Download mbox | patch
Permalink /patch/12260/
State Accepted
Delegated to: Yuya Nishihara
Headers show

Comments

Matt Harbison - Dec. 23, 2015, 4:22 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1450838860 18000
#      Tue Dec 22 21:47:40 2015 -0500
# Node ID 8f83787abed009b037f0c94cb42207b34c9c87b8
# Parent  fe376159a58d9b3d748b669ac011b0eed0346fea
import-checker: force 'ctype.util' to stdlib module

Not having this caused warnings on Windows:

  mercurial/pure/osutil.py:12: stdlib import follows local import: os
  mercurial/pure/osutil.py:13: stdlib import follows local import: socket
  mercurial/pure/osutil.py:14: stdlib import follows local import: stat
  mercurial/pure/osutil.py:15: stdlib import follows local import: sys
Yuya Nishihara - Dec. 23, 2015, 10:53 a.m.
On Tue, 22 Dec 2015 23:22:55 -0500, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1450838860 18000
> #      Tue Dec 22 21:47:40 2015 -0500
> # Node ID 8f83787abed009b037f0c94cb42207b34c9c87b8
> # Parent  fe376159a58d9b3d748b669ac011b0eed0346fea
> import-checker: force 'ctype.util' to stdlib module
> 
> Not having this caused warnings on Windows:
> 
>   mercurial/pure/osutil.py:12: stdlib import follows local import: os
>   mercurial/pure/osutil.py:13: stdlib import follows local import: socket
>   mercurial/pure/osutil.py:14: stdlib import follows local import: stat
>   mercurial/pure/osutil.py:15: stdlib import follows local import: sys
> 
> diff --git a/contrib/import-checker.py b/contrib/import-checker.py
> --- a/contrib/import-checker.py
> +++ b/contrib/import-checker.py
> @@ -180,7 +180,7 @@
>      for m in ['msvcrt', '_winreg']:
>          yield m
>      # These get missed too
> -    for m in 'ctypes', 'email', 'multiprocessing':
> +    for m in 'ctypes', 'ctypes.util', 'email', 'multiprocessing':

My bad. Pushed these to the clowncopter, thanks.

Patch

diff --git a/contrib/import-checker.py b/contrib/import-checker.py
--- a/contrib/import-checker.py
+++ b/contrib/import-checker.py
@@ -180,7 +180,7 @@ 
     for m in ['msvcrt', '_winreg']:
         yield m
     # These get missed too
-    for m in 'ctypes', 'email', 'multiprocessing':
+    for m in 'ctypes', 'ctypes.util', 'email', 'multiprocessing':
         yield m
     yield 'builtins' # python3 only
     for m in 'fcntl', 'grp', 'pwd', 'termios':  # Unix only