[PATCH 2 of 2] import-checker: force 'fcntl', 'grp', 'pwd', and 'termios' to stdlib modules

Augie Fackler raf at durin42.com
Thu Apr 9 10:20:26 CDT 2015


On Wed, Apr 08, 2015 at 10:51:06PM -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison at yahoo.com>
> # Date 1428546710 14400
> #      Wed Apr 08 22:31:50 2015 -0400
> # Node ID 84c7786145a000e1d92b31f508490fbd8c9d2534
> # Parent  81873bb2a01d0b746171a7e7c07667009f501d9e
> import-checker: force 'fcntl', 'grp', 'pwd', and 'termios' to stdlib modules

queued these, many thanks for all your hard work on windows stuff

>
> These are Unix only, and caused these additional warnings on Windows if they
> aren't hardcoded as stdlib:
>
>   mercurial/posix.py mixed imports
>      stdlib:    errno, getpass, os, socket, stat, sys, tempfile
>      relative:  grp, pwd, unicodedata
>   mercurial/posix.py mixed imports
>      stdlib:    re
>      relative:  fcntl
>   mercurial/posix.py mixed imports
>      stdlib:    array
>      relative:  termios
>
> Additionally, this was missing on Windows:
>
>   mercurial/crecord.py mixed imports
>      stdlib:    fcntl, termios
>      relative:  curses
>
>
> https://docs.python.org/2/library/fcntl.html
> https://docs.python.org/2/library/grp.html
> https://docs.python.org/2/library/pwd.html
> https://docs.python.org/2/library/termios.html
>
> diff --git a/contrib/import-checker.py b/contrib/import-checker.py
> --- a/contrib/import-checker.py
> +++ b/contrib/import-checker.py
> @@ -61,6 +61,8 @@
>      for m in 'ctypes', 'email':
>          yield m
>      yield 'builtins' # python3 only
> +    for m in 'fcntl', 'grp', 'pwd', 'termios':  # Unix only
> +        yield m
>      stdlib_prefixes = set([sys.prefix, sys.exec_prefix])
>      # We need to supplement the list of prefixes for the search to work
>      # when run from within a virtualenv.
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list