Skip to content

check Python version with sys.version_info - #227

Merged
brian-brazil merged 1 commit into
prometheus:masterfrom
minrk:python-version-check
Dec 19, 2017
Merged

brian-brazil merged 1 commit into
prometheus:masterfrom
minrk:python-version-check

Conversation

@minrk

@minrk minrk commented Dec 19, 2017

Copy link
Copy Markdown
Contributor

sys.version_info is a parsed tuple of numbers, so not vulnerable to incorrect string version comparison (e.g. '10' < '3') or parse errors on sys.version.

Discovered because prometheus-client cannot be imported on development versions of Python which have version strings like 3.7.0a0.

sys.version_info is a parsed tuple of numbers,
so not vulnerable to incorrect string version comparison (e.g. '10' < '3')

Discovered because prometheus-client cannot be imported on development versions of Python
which have version strings like `'3.7.0a0'`
@brian-brazil
brian-brazil merged commit d3562a1 into prometheus:master Dec 19, 2017
@brian-brazil

Copy link
Copy Markdown
Contributor

Thanks!

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