]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/__init__.py
Remove Python 3.7 support (#8361)
[yt-dlp.git] / yt_dlp / __init__.py
index 991dbcda7e65d086721dcf4fbc650c838ac6a4e1..446f0c47b9bde441cb2db5e673230053bcd4d25f 100644 (file)
@@ -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 optparse
 import os
 import re
-import sys
 import traceback
 
 from .compat import compat_shlex_quote