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

python_version_tuple in identify_filenames.py returning incorrectly #481

Closed
h-ssh opened this issue Dec 17, 2024 · 1 comment
Closed

python_version_tuple in identify_filenames.py returning incorrectly #481

h-ssh opened this issue Dec 17, 2024 · 1 comment

Comments

@h-ssh
Copy link
Contributor

h-ssh commented Dec 17, 2024

import platform
if platform.python_version_tuple() < ('3','2','0'):
     raise RuntimeError('This script now requires Python 3.2 or above')

python_version_tuple returns a string tuple of the python version - e.g. ('3','10','12')

String comparison in python will return incorrectly in this case

Python 3.10.12 (main, Nov  6 2024, 20:22:13) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> print((platform.python_version_tuple()) < ('3','2','0'))
True

Proposed change

import sys
if sys.version_info < (3,2):
    raise RuntimeError('This script now requires Python 3.2 or above')
@h-ssh
Copy link
Contributor Author

h-ssh commented Dec 18, 2024

PR #482

@h-ssh h-ssh closed this as completed Dec 18, 2024
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

No branches or pull requests

1 participant