import-checker: force 'fcntl', 'grp', 'pwd', and 'termios' to stdlib modules
authorMatt Harbison <matt_harbison@yahoo.com>
Wed, 08 Apr 2015 22:31:50 -0400
changeset 24669 fbdbff1b486a
parent 24668 81873bb2a01d
child 24670 dfb86af18a35
import-checker: force 'fcntl', 'grp', 'pwd', and 'termios' to stdlib modules 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
contrib/import-checker.py
--- a/contrib/import-checker.py	Wed Apr 08 22:23:51 2015 -0400
+++ b/contrib/import-checker.py	Wed Apr 08 22:31:50 2015 -0400
@@ -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.