]> jfr.im git - yt-dlp.git/commitdiff
[websocket] Make syntax error in `websockets` module non-fatal
authorpukkandan <redacted>
Fri, 4 Feb 2022 05:02:44 +0000 (10:32 +0530)
committerpukkandan <redacted>
Fri, 4 Feb 2022 06:32:01 +0000 (12:02 +0530)
Closes #2633

yt_dlp/downloader/websocket.py

index 088222046b7e5ca537f23792f801cde21b67f308..daac348842c8462b911d4f777c97381bd595aab5 100644 (file)
@@ -5,9 +5,12 @@
 
 try:
     import websockets
-    has_websockets = True
-except ImportError:
+except (ImportError, SyntaxError):
+    # websockets 3.10 on python 3.6 causes SyntaxError
+    # See https://github.com/yt-dlp/yt-dlp/issues/2633
     has_websockets = False
+else:
+    has_websockets = True
 
 from .common import FileDownloader
 from .external import FFmpegFD