diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-06-24 13:40:17 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-06-25 00:08:55 +0530 |
commit | ac668111128b5f124b4271b3aa4c35f6e71a4749 (patch) | |
tree | 2a824880c707248076748070f7505cfb05200399 /test/test_download.py | |
parent | 3c5386cd711a5a0480a0b8d72e9df5007b10ac92 (diff) | |
download | hypervideo-pre-ac668111128b5f124b4271b3aa4c35f6e71a4749.tar.lz hypervideo-pre-ac668111128b5f124b4271b3aa4c35f6e71a4749.tar.xz hypervideo-pre-ac668111128b5f124b4271b3aa4c35f6e71a4749.zip |
[compat] Remove more functions
Removing any more will require changes to a large number of extractors
Diffstat (limited to 'test/test_download.py')
-rwxr-xr-x | test/test_download.py | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/test/test_download.py b/test/test_download.py index c9825c074..b82f174bb 100755 --- a/test/test_download.py +++ b/test/test_download.py @@ -1,14 +1,18 @@ #!/usr/bin/env python3 # Allow direct execution -import hashlib -import json import os -import socket import sys import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +import hashlib +import json +import socket +import urllib.error +import http.client + from test.helper import ( assertGreaterEqual, expect_info_dict, @@ -19,13 +23,8 @@ from test.helper import ( report_warning, try_rm, ) - -import yt_dlp.YoutubeDL -from yt_dlp.compat import ( - compat_http_client, - compat_HTTPError, - compat_urllib_error, -) +import yt_dlp.YoutubeDL # isort: split +from yt_dlp.compat import compat_HTTPError from yt_dlp.extractor import get_info_extractor from yt_dlp.utils import ( DownloadError, @@ -167,7 +166,7 @@ def generator(test_case, tname): force_generic_extractor=params.get('force_generic_extractor', False)) except (DownloadError, ExtractorError) as err: # Check if the exception is not a network related one - if not err.exc_info[0] in (compat_urllib_error.URLError, socket.timeout, UnavailableVideoError, compat_http_client.BadStatusLine) or (err.exc_info[0] == compat_HTTPError and err.exc_info[1].code == 503): + if not err.exc_info[0] in (urllib.error.URLError, socket.timeout, UnavailableVideoError, http.client.BadStatusLine) or (err.exc_info[0] == compat_HTTPError and err.exc_info[1].code == 503): raise if try_num == RETRIES: |