Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fix for type checking with pyright #157

Merged

Conversation

StollD
Copy link
Contributor

@StollD StollD commented Oct 18, 2024

The type checker that is included with Visual Studio Code (pyright) will only resolve imports in the try branch of a try-except statement.

This means that VSPresetVideoFormat won't be resolved if your typing stubs are up-to-date, as the correct import is in the except branch.

Swapping the try and except branches makes it work with freshly generated stubs, but will break older ones. However, since there is (seemingly) no way to make it work with both, having newer ones work seems like the better compromise to me.

The type checker that is included with Visual Studio Code (pyright)
will only resolve imports in the try branch of a try-except statement.

This means that VSPresetVideoFormat won't be resolved if your typing
stubs are up-to-date, as the correct import is in the except branch.

Swapping the try and except branches makes it work with freshly
generated stubs, but will break older ones. However, since there is
(seemingly) no way to make it work with both, having newer ones work
seems like the better compromise to me.
@LightArrowsEXE LightArrowsEXE merged commit fbfcc6b into Jaded-Encoding-Thaumaturgy:master Oct 18, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants