Remove some hardcoded modules from generate_known_standard_library.py (#11409)

See feedback in: https://github.com/astral-sh/ruff/pull/11374
This commit is contained in:
Charlie Marsh 2024-05-13 12:27:34 -04:00 committed by GitHub
parent c3c87e86ef
commit dc5c44ccc4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 11 deletions

View file

@ -245,7 +245,6 @@ pub fn is_known_standard_library(minor_version: u8, module: &str) -> bool {
| "socketserver"
| "spwd"
| "sqlite3"
| "sre"
| "sre_compile"
| "sre_constants"
| "sre_parse"

View file

@ -27,18 +27,10 @@ pub fn is_known_standard_library(minor_version: u8, module: &str) -> bool {
modules_by_version = {}
for major_version, minor_version in VERSIONS:
modules = {
"_ast",
"posixpath",
"ntpath",
"sre_constants",
"sre_parse",
"sre_compile",
"sre",
}
modules = set()
for module in stdlib_module_names(f"{major_version}.{minor_version}"):
if module not in ["__future__", "__main__"]:
if module != "__future__":
modules.add(module)
modules_by_version[minor_version] = modules