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

Commit

Permalink
Workaround a false positive about indexing into refs
Browse files Browse the repository at this point in the history
```
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
  • Loading branch information
David Robertson committed Apr 8, 2022
1 parent 24708f6 commit 87f9e19
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts-dev/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,8 @@ def parse_version_from_module() -> Tuple[

def find_ref(repo: git.Repo, ref_name: str) -> Optional[git.HEAD]:
"""Find the branch/ref, looking first locally then in the remote."""
if ref_name in repo.refs:
return repo.refs[ref_name]
if ref_name in repo.references:
return repo.references[ref_name]
elif ref_name in repo.remote().refs:
return repo.remote().refs[ref_name]
else:
Expand Down

0 comments on commit 87f9e19

Please sign in to comment.