瀏覽代碼

[downloader/http] Properly handle missing message in SSLError (closes #26646)

Sergey M․ 5 年之前
父節點
當前提交
c5764b3f89
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      youtube_dl/downloader/http.py

+ 1 - 1
youtube_dl/downloader/http.py

@@ -241,7 +241,7 @@ class HttpFD(FileDownloader):
                 except socket.error as e:
                     # SSLError on python 2 (inherits socket.error) may have
                     # no errno set but this error message
-                    if e.errno in (errno.ECONNRESET, errno.ETIMEDOUT) or getattr(e, 'message') == 'The read operation timed out':
+                    if e.errno in (errno.ECONNRESET, errno.ETIMEDOUT) or getattr(e, 'message', None) == 'The read operation timed out':
                         retry(e)
                     raise