Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit f03db34

Browse files
author
David Robertson
committed
Workaround a false positive about indexing into refs
``` scripts-dev/release.py:495: error: Unsupported right operand type for in ("Callable[[], IterableList[Reference]]") [operator] scripts-dev/release.py:496: error: Value of type "Callable[[], IterableList[Reference]]" is not indexable [index] ``` `refs` is an alias the the property `references`. Mypy gets confused by the alias, see python/mypy#6700
1 parent b3c9721 commit f03db34

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts-dev/release.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,8 +492,8 @@ def parse_version_from_module() -> Tuple[
492492

493493
def find_ref(repo: git.Repo, ref_name: str) -> Optional[git.HEAD]:
494494
"""Find the branch/ref, looking first locally then in the remote."""
495-
if ref_name in repo.refs:
496-
return repo.refs[ref_name]
495+
if ref_name in repo.references:
496+
return repo.references[ref_name]
497497
elif ref_name in repo.remote().refs:
498498
return repo.remote().refs[ref_name]
499499
else:

0 commit comments

Comments
 (0)