diff contrib/import-checker.py @ 43954:303576116ac1

import-checker: allow all absolute imports of stdlib modules Before this patch, we didn't allow imports like from importlib import resources (That's the reason I used `import importlib.resources` in D7629.) I think that form is still an absolute import, so I don't think we forbade on purpose. Differential Revision: https://phab.mercurial-scm.org/D7700
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 18 Dec 2019 13:39:44 -0800
parents 0ad5d6c4bfad
children 4cabeea6d214
line wrap: on
line diff
--- a/contrib/import-checker.py	Tue Dec 17 22:36:40 2019 -0500
+++ b/contrib/import-checker.py	Wed Dec 18 13:39:44 2019 -0800
@@ -536,7 +536,7 @@
                 if not fullname or (
                     fullname in stdlib_modules
                     # allow standard 'from typing import ...' style
-                    and fullname != 'typing'
+                    and fullname.startswith('.')
                     and fullname not in localmods
                     and fullname + '.__init__' not in localmods
                 ):