Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Python] Avoid InvalidStateError on cancel (#35380)
When the co-routine GetConnectedDevice() gets cancelled, the wait_for call will cancel the future we are waiting for. However, the SDK still calls the _DeviceAvailableCallback with an error (CHIP Error 0x00000074: The operation has been cancelled). However, we can't set the future result at this point as the co-routine is already cancelled. Simply check the future state before setting the result.
- Loading branch information