mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-10-15 14:56:37 +00:00
@@ -1,8 +1,8 @@
|
||||
try:
|
||||
import contextvars # noqa: F401
|
||||
except Exception:
|
||||
raise Exception(
|
||||
f'You are using an unsupported version of Python. Only Python versions 3.7 and above are supported by yt-dlp') # noqa: F541
|
||||
import sys
|
||||
|
||||
if sys.version_info < (3, 8):
|
||||
raise ImportError(
|
||||
f'You are using an unsupported version of Python. Only Python versions 3.8 and above are supported by yt-dlp') # noqa: F541
|
||||
|
||||
__license__ = 'Public Domain'
|
||||
|
||||
@@ -12,7 +12,6 @@ import itertools
|
||||
import optparse
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
from .compat import compat_shlex_quote
|
||||
|
@@ -10,17 +10,3 @@ try:
|
||||
cache # >= 3.9
|
||||
except NameError:
|
||||
cache = lru_cache(maxsize=None)
|
||||
|
||||
try:
|
||||
cached_property # >= 3.8
|
||||
except NameError:
|
||||
class cached_property:
|
||||
def __init__(self, func):
|
||||
update_wrapper(self, func)
|
||||
self.func = func
|
||||
|
||||
def __get__(self, instance, _):
|
||||
if instance is None:
|
||||
return self
|
||||
setattr(instance, self.func.__name__, self.func(instance))
|
||||
return getattr(instance, self.func.__name__)
|
||||
|
@@ -131,7 +131,7 @@ def _get_binary_name():
|
||||
|
||||
|
||||
def _get_system_deprecation():
|
||||
MIN_SUPPORTED, MIN_RECOMMENDED = (3, 7), (3, 8)
|
||||
MIN_SUPPORTED, MIN_RECOMMENDED = (3, 8), (3, 8)
|
||||
|
||||
if sys.version_info > MIN_RECOMMENDED:
|
||||
return None
|
||||
@@ -140,16 +140,8 @@ def _get_system_deprecation():
|
||||
if sys.version_info < MIN_SUPPORTED:
|
||||
msg = f'Python version {major}.{minor} is no longer supported'
|
||||
else:
|
||||
msg = f'Support for Python version {major}.{minor} has been deprecated. '
|
||||
# Temporary until `win_x86_exe` uses 3.8, which will deprecate Vista and Server 2008
|
||||
if detect_variant() == 'win_x86_exe':
|
||||
platform_name = platform.platform()
|
||||
if any(platform_name.startswith(f'Windows-{name}') for name in ('Vista', '2008Server')):
|
||||
msg = 'Support for Windows Vista/Server 2008 has been deprecated. '
|
||||
else:
|
||||
return None
|
||||
msg += ('See https://github.com/yt-dlp/yt-dlp/issues/7803 for details.'
|
||||
'\nYou may stop receiving updates on this version at any time')
|
||||
msg = (f'Support for Python version {major}.{minor} has been deprecated. '
|
||||
'\nYou may stop receiving updates on this version at any time')
|
||||
|
||||
major, minor = MIN_RECOMMENDED
|
||||
return f'{msg}! Please update to Python {major}.{minor} or above'
|
||||
|
Reference in New Issue
Block a user