gh-120417: Fix "imported but unused" linter warnings (#120461)

Add __all__ to the following modules:
importlib.machinery, importlib.util and xml.sax.

Add also "# noqa: F401" in collections.abc,
subprocess and xml.sax.

* Sort __all__; remove collections.abc.__all__; remove private names

* Add tests
This commit is contained in:
Victor Stinner 2024-06-14 20:39:50 +02:00 committed by GitHub
parent ed60ab5fab
commit 05df063ad8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 84 additions and 8 deletions

View file

@ -270,3 +270,9 @@ class LazyLoader(Loader):
loader_state['is_loading'] = False
module.__spec__.loader_state = loader_state
module.__class__ = _LazyModule
__all__ = ['LazyLoader', 'Loader', 'MAGIC_NUMBER',
'cache_from_source', 'decode_source', 'find_spec',
'module_from_spec', 'resolve_name', 'source_from_cache',
'source_hash', 'spec_from_file_location', 'spec_from_loader']