Skip to content

Commit

Permalink
Fix mypy warnings and update typing
Browse files Browse the repository at this point in the history
  • Loading branch information
crazybolillo authored and jacobtylerwalls committed May 4, 2024
1 parent 2592505 commit 2ec0115
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions astroid/interpreter/_import/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import types
import warnings
import zipimport
from collections.abc import Iterator, Sequence
from collections.abc import Iterable, Iterator, Sequence
from functools import lru_cache
from pathlib import Path
from typing import Any, Literal, NamedTuple, Protocol
Expand Down Expand Up @@ -424,7 +424,7 @@ def _find_spec_with_path(
raise ImportError(f"No module named {'.'.join(module_parts)}")


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


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

# Need a copy for not mutating the argument.
modpath = list(modpath)
modpath = list(module_path)

submodule_path = None
module_parts = modpath[:]
Expand Down

0 comments on commit 2ec0115

Please sign in to comment.