mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 02:16:09 -05:00
Set 3.6.6 as minimum python version on Windows (#2117)
* Set 3.6.6 as minimum python version on Windows Signed-off-by: Toby Harradine <tobyharradine@gmail.com> * Conditional python_requires in setup.py Signed-off-by: Toby Harradine <tobyharradine@gmail.com> * Should probably add the comment too Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
This commit is contained in:
@@ -25,7 +25,6 @@ from redbot.core.cli import confirm
|
||||
if sys.platform == "linux":
|
||||
import distro
|
||||
|
||||
PYTHON_OK = sys.version_info >= (3, 6, 2)
|
||||
INTERACTIVE_MODE = not len(sys.argv) > 1 # CLI flags = non-interactive
|
||||
|
||||
INTRO = "==========================\nRed Discord Bot - Launcher\n==========================\n"
|
||||
@@ -33,6 +32,14 @@ INTRO = "==========================\nRed Discord Bot - Launcher\n===============
|
||||
IS_WINDOWS = os.name == "nt"
|
||||
IS_MAC = sys.platform == "darwin"
|
||||
|
||||
if IS_WINDOWS:
|
||||
# Due to issues with ProactorEventLoop prior to 3.6.6 (bpo-26819)
|
||||
MIN_PYTHON_VERSION = (3, 6, 6)
|
||||
else:
|
||||
MIN_PYTHON_VERSION = (3, 6, 2)
|
||||
|
||||
PYTHON_OK = sys.version_info >= MIN_PYTHON_VERSION
|
||||
|
||||
|
||||
def is_venv():
|
||||
"""Return True if the process is in a venv or in a virtualenv."""
|
||||
@@ -461,9 +468,11 @@ def main_menu():
|
||||
|
||||
def main():
|
||||
if not PYTHON_OK:
|
||||
raise RuntimeError(
|
||||
"Red requires Python 3.6.2 or greater. Please install the correct version!"
|
||||
print(
|
||||
f"Python {'.'.join(map(str, MIN_PYTHON_VERSION))} is required to run Red, but you "
|
||||
f"have {sys.version}! Please update Python."
|
||||
)
|
||||
sys.exit(1)
|
||||
if args.debuginfo: # Check first since the function triggers an exit
|
||||
debug_info()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user