Skip to content

Commit

Permalink
Handle None case.
Browse files Browse the repository at this point in the history
  • Loading branch information
ggoretkin-bdai committed Jan 10, 2024
1 parent 5a593cb commit 312709f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spot_wrapper/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -851,8 +851,8 @@ def lease(self) -> typing.List[lease_pb2.LeaseResource]:
return self._lease_task.proto

@property
def lease2(self) -> Lease:
"""Return the most recently `take`n or `acquire`d lease"""
def lease2(self) -> typing.Optional[Lease]:
"""Return the most recently `take`n or `acquire`d lease, or `None` if it is `release`d."""
return self._lease

@property
Expand Down

0 comments on commit 312709f

Please sign in to comment.