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

Commit fdb7ca1

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 22de326 commit fdb7ca1

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
@@ -491,8 +491,8 @@ def parse_version_from_module() -> Tuple[
491491

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

0 commit comments

Comments
 (0)