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

fix tuple int comparison error in version check #54

Merged
merged 1 commit into from
Jun 6, 2023

Conversation

charlesfrye
Copy link
Contributor

Thanks for making this plugin!

My builds started failing with the latest release. Here's an example.

tl;dr: I'm getting errors on the new version info comparison wrapped around the locale setting, because the commit to resolve #50 introduced the expression sys.version_info[0] < (3, 11), which produces 3 < (3, 11) and then a TypeError. This code path is only triggered if _locale is not set in the call, so it may have been missed in testing.

The change in this PR should give the desired behavior. We check the tuple sys.version_info[:2] against (3, 11) instead. FWICT, this retains compatibility with Python <= 3.0 (docs here). If Python >= 3.1 is okay, then (sys.version_info.major, sys.version_info.minor) in place of the direct indexing would be more clear.

Note that this commit also adds a newline at the end of file -- that's the default behavior of most editors. You can edit to remove it if you want.

@liang2kl
Copy link
Owner

liang2kl commented Jun 6, 2023

Thanks for the PR!

@liang2kl liang2kl merged commit 603aa66 into liang2kl:main Jun 6, 2023
2 checks passed
liang2kl added a commit that referenced this pull request Jun 6, 2023
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.

[BUG] DeprecationWarning: Use setlocale(), getencoding() and getlocale() instead
2 participants