Skip to content

Commit

Permalink
typing: update version compare to support pyright/pylance (#424)
Browse files Browse the repository at this point in the history
The current version comparison works with mypy but pyright doesn't
handle it.

Comparing against minor and major version allows it to work with pyright.

related: microsoft/pyright#6639
  • Loading branch information
sbdchd authored Dec 3, 2023
1 parent b647dcd commit ebee81d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tenacity/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ def __call__(
return do # type: ignore[no-any-return]


if sys.version_info[1] >= 9:
if sys.version_info >= (3, 9):
FutureGenericT = futures.Future[t.Any]
else:
FutureGenericT = futures.Future
Expand Down

0 comments on commit ebee81d

Please sign in to comment.