def _checkPythonVersion():
    """
    Fail if we detect a version of Python we don't support.
    """
    version = getattr(sys, "version_info", (0,))
    if version < (2, 7):
        raise ImportError("Twisted requires Python 2.7 or later.")
    elif version >= (3, 0) and version < (3, 5):
        raise ImportError("Twisted on Python 3 requires Python 3.5 or later.")

    Fail if we detect a version of Python we don't support.
    
stackoverflow/venv/lib/python3.6/site-packages/twisted/python/_setup.py