diff --git a/contrib/import-checker.py b/contrib/import-checker.py --- a/contrib/import-checker.py +++ b/contrib/import-checker.py @@ -260,9 +260,9 @@ break else: stdlib_prefixes.add(dirname) - for libpath in sys.path: - # We want to walk everything in sys.path that starts with - # something in stdlib_prefixes. + for libpath in sys.path[1:]: + # We want to walk everything in sys.path (other than the directory of + # the current script) that starts with something in stdlib_prefixes. if not any(libpath.startswith(p) for p in stdlib_prefixes): continue for top, dirs, files in os.walk(libpath):