1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #28708 -- Added constants to detect the Python version.

This commit is contained in:
Tim Graham
2017-10-12 11:08:05 -04:00
parent abb636c1af
commit 941b0a5b33
4 changed files with 13 additions and 6 deletions

View File

@@ -2,8 +2,18 @@ import datetime
import functools
import os
import subprocess
import sys
from distutils.version import LooseVersion
# Private, stable API for detecting the Python version. PYXY means "Python X.Y
# or later". So that third-party apps can use these values, each constant
# should remain as long as the oldest supported Django version supports that
# Python version.
PY36 = sys.version_info >= (3, 6)
PY37 = sys.version_info >= (3, 7)
PY38 = sys.version_info >= (3, 8)
PY39 = sys.version_info >= (3, 9)
def get_version(version=None):
"""Return a PEP 440-compliant version number from VERSION."""