diff options
author | Jeppe Fihl-Pearson <jeppe@tenzer.dk> | 2019-02-28 15:03:37 +0000 |
---|---|---|
committer | Jeppe Fihl-Pearson <jeppe@tenzer.dk> | 2019-02-28 15:03:37 +0000 |
commit | 1e761b48c6fa922e3928f3635cb6bf077c5215f1 (patch) | |
tree | be32cd7fabf97c81d349c04769d50545e8a8f3d6 | |
parent | 6e8389b5214a6ca5131dfe9ec3c48f842dd4b0a2 (diff) | |
download | isort-1e761b48c6fa922e3928f3635cb6bf077c5215f1.tar.gz |
Switch RequiementsFinder._get_names back return an iterator
This is in order to satisfy mypy as the return type should be the same as the
super class.
-rw-r--r-- | isort/finders.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/isort/finders.py b/isort/finders.py index 75a79951..8038be7b 100644 --- a/isort/finders.py +++ b/isort/finders.py @@ -289,10 +289,11 @@ class RequirementsFinder(ReqsBaseFinder): yield full_path break - def _get_names(self, path: str) -> List[str]: + def _get_names(self, path: str) -> Iterator[str]: """Load required packages from path to requirements file """ - return RequirementsFinder._get_names_cached(path) + for i in RequirementsFinder._get_names_cached(path): + yield i @classmethod @lru_cache(maxsize=16) |