mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-24 05:36:56 +01:00
[http] Fix bug in retrying on read timeout in py < 3.10
socket.timeout is not an alias of TimeoutError in py < 3.10
Fixes bug in a2e77303e3
Authored-by: coletdjnz
This commit is contained in:
parent
0fa7d2c8e4
commit
5faf6528fb
@ -1,5 +1,6 @@
|
|||||||
import os
|
import os
|
||||||
import random
|
import random
|
||||||
|
import socket
|
||||||
import ssl
|
import ssl
|
||||||
import time
|
import time
|
||||||
|
|
||||||
@ -18,7 +19,13 @@
|
|||||||
write_xattr,
|
write_xattr,
|
||||||
)
|
)
|
||||||
|
|
||||||
RESPONSE_READ_EXCEPTIONS = (TimeoutError, ConnectionError, ssl.SSLError, compat_http_client.HTTPException)
|
RESPONSE_READ_EXCEPTIONS = (
|
||||||
|
TimeoutError,
|
||||||
|
socket.timeout, # compat: py < 3.10
|
||||||
|
ConnectionError,
|
||||||
|
ssl.SSLError,
|
||||||
|
compat_http_client.HTTPException
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class HttpFD(FileDownloader):
|
class HttpFD(FileDownloader):
|
||||||
|
Loading…
Reference in New Issue
Block a user