]> jfr.im git - yt-dlp.git/commitdiff
Add deprecation warning for Py3.6
authorpukkandan <redacted>
Wed, 22 Jun 2022 00:50:40 +0000 (06:20 +0530)
committerpukkandan <redacted>
Wed, 22 Jun 2022 00:50:40 +0000 (06:20 +0530)
See: https://github.com/yt-dlp/yt-dlp/issues/3764

README.md
yt_dlp/YoutubeDL.py

index 1d51dca352f595c9082925ac3f6e9f66c4a73618..c72703818e4c42d15c201f6f4a8643bda94696c8 100644 (file)
--- a/README.md
+++ b/README.md
@@ -264,7 +264,7 @@ #### Misc
 <!-- MANPAGE: END EXCLUDED SECTION -->
 
 ## DEPENDENCIES
-Python versions 3.6+ (CPython and PyPy) are supported. Other versions and implementations may or may not work correctly.
+Python versions 3.7+ (CPython and PyPy) are supported. Other versions and implementations may or may not work correctly.
 
 <!-- Python 3.5+ uses VC++14 and it is already embedded in the binary created
 <!x-- https://www.microsoft.com/en-us/download/details.aspx?id=26999 --x>
index c59502161207c3ccdcd832589f1fd47840588b5d..bd6d0d0c1ada3eeb833841adb7ddadb24efb1ce8 100644 (file)
@@ -582,9 +582,14 @@ def __init__(self, params=None, auto_init=True):
             for type_, stream in self._out_files.items_ if type_ != 'console'
         })
 
-        if sys.version_info < (3, 6):
-            self.report_warning(
-                'Python version %d.%d is not supported! Please update to Python 3.6 or above' % sys.version_info[:2])
+        MIN_SUPPORTED, MIN_RECOMMENDED = (3, 6), (3, 7)
+        current_version = sys.version_info[:2]
+        if current_version < MIN_RECOMMENDED:
+            msg = 'Support for Python version %d.%d has been deprecated and will break in future versions of yt-dlp'
+            if current_version < MIN_SUPPORTED:
+                msg = 'Python version %d.%d is no longer supported'
+            self.deprecation_warning(
+                f'{msg}! Please update to Python %d.%d or above' % (*current_version, *MIN_RECOMMENDED))
 
         if self.params.get('allow_unplayable_formats'):
             self.report_warning(