mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Don't return frozenset for modules (#7276)
This commit is contained in:
1 parent
330d884587
commit
cf66ed14b5
1 file changed
+4
-6
@@ -36,7 +36,7 @@ class ImportVisitor(ast.NodeVisitor):
|
||||
self.__imports = set()
|
||||
|
||||
@property
|
||||
def test_imports(self) -> frozenset[str]:
|
||||
def test_imports(self) -> set[str]:
|
||||
imports = set()
|
||||
for module in self.__imports:
|
||||
if not module.startswith("test."):
|
||||
@@ -48,13 +48,11 @@ class ImportVisitor(ast.NodeVisitor):
|
||||
|
||||
imports.add(name)
|
||||
|
||||
return frozenset(imports)
|
||||
return imports
|
||||
|
||||
@property
|
||||
def lib_imports(self) -> frozenset[str]:
|
||||
return frozenset(
|
||||
module for module in self.__imports if not module.startswith("test.")
|
||||
)
|
||||
def lib_imports(self) -> set[str]:
|
||||
return {module for module in self.__imports if not module.startswith("test.")}
|
||||
|
||||
def visit_Import(self, node):
|
||||
for alias in node.names:
|
||||
|
||||
Reference in new issue
Block a user