Skip to content

Commit 2ec0115

Browse files
crazybolillojacobtylerwalls
authored andcommitted
Fix mypy warnings and update typing
1 parent 2592505 commit 2ec0115

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

astroid/interpreter/_import/spec.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import types
1616
import warnings
1717
import zipimport
18-
from collections.abc import Iterator, Sequence
18+
from collections.abc import Iterable, Iterator, Sequence
1919
from functools import lru_cache
2020
from pathlib import Path
2121
from typing import Any, Literal, NamedTuple, Protocol
@@ -424,7 +424,7 @@ def _find_spec_with_path(
424424
raise ImportError(f"No module named {'.'.join(module_parts)}")
425425

426426

427-
def find_spec(modpath: list[str], path: Sequence[str] | None = None) -> ModuleSpec:
427+
def find_spec(modpath: Iterable[str], path: Iterable[str] | None = None) -> ModuleSpec:
428428
"""Find a spec for the given module.
429429
430430
:type modpath: list or tuple
@@ -445,11 +445,11 @@ def find_spec(modpath: list[str], path: Sequence[str] | None = None) -> ModuleSp
445445

446446

447447
@lru_cache(maxsize=1024)
448-
def _find_spec(modpath: tuple, path: tuple) -> ModuleSpec:
448+
def _find_spec(module_path: tuple, path: tuple) -> ModuleSpec:
449449
_path = path or sys.path
450450

451451
# Need a copy for not mutating the argument.
452-
modpath = list(modpath)
452+
modpath = list(module_path)
453453

454454
submodule_path = None
455455
module_parts = modpath[:]

0 commit comments

Comments
 (0)