From 1e5d87beee7683cbb75d12f8e52bddce5c5b7717 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Fri, 4 Feb 2022 10:32:44 +0530 Subject: [PATCH] [websocket] Make syntax error in `websockets` module non-fatal Closes #2633 --- yt_dlp/downloader/websocket.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/yt_dlp/downloader/websocket.py b/yt_dlp/downloader/websocket.py index 088222046..daac34884 100644 --- a/yt_dlp/downloader/websocket.py +++ b/yt_dlp/downloader/websocket.py @@ -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