fix: code quality issue#226
Open
Kanchan-Microsoft wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates voice_live.py to assign the result of an awaited close() coroutine to a throwaway variable (_) in two places during credential cleanup.
Changes:
- Updated
VoiceLiveHandler.stop()to assignawait close_resultto_. - Updated
text_to_speech()cleanup to assignawait close_resultto_.
Comments suppressed due to low confidence (1)
src/api/app/routers/voice_live.py:614
- Assigning the awaited result to
_will trigger flake8/pyflakesF841 local variable '_' is assigned to but never used(the repo's.flake8does not ignore F841). Prefer a plainawait close_result(or add an explicit noqa if you truly need the assignment).
close_result = close_fn()
if asyncio.iscoroutine(close_result):
_ = await close_result
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Roopan-Microsoft
approved these changes
May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
This pull request makes a minor update to the
src/api/app/routers/voice_live.pyfile. The change assigns the result of an awaited coroutine to a throwaway variable (_) instead of directly awaiting it without assignment. This is a stylistic improvement and does not affect functionality.await close_resultto_in both thestopandtext_to_speechfunctions to clarify intent and follow best practices. [1] [2]Does this introduce a breaking change?
How to Test
What to Check
Verify that the following are valid
Other Information