changeset 43596:0ad5d6c4bfad

import-checker: allow 'from typing import ...' Suppresses the following error in test-check-module-imports.t: mercurial/encoding.py:24: relative import of stdlib module
author Yuya Nishihara <yuya@tcha.org>
date Mon, 11 Nov 2019 22:10:26 +0900
parents ecd11c4d3834
children 2a8cd7edf409
files contrib/import-checker.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/import-checker.py	Tue Oct 29 23:33:34 2019 -0700
+++ b/contrib/import-checker.py	Mon Nov 11 22:10:26 2019 +0900
@@ -535,6 +535,8 @@
             if fullname != '__future__':
                 if not fullname or (
                     fullname in stdlib_modules
+                    # allow standard 'from typing import ...' style
+                    and fullname != 'typing'
                     and fullname not in localmods
                     and fullname + '.__init__' not in localmods
                 ):