mirror of
https://github.com/ytdl-org/youtube-dl
synced 2025-07-22 19:34:14 +09:00
Merge 78d9d0b7251c9c572f2d178426ff5aa0661c437d into 384f632e8a9b61e864a26678d85b2b39933b9bae
This commit is contained in:
commit
f47a93631e
@ -16,6 +16,7 @@ from .options import (
|
||||
parseOpts,
|
||||
)
|
||||
from .compat import (
|
||||
compat_BrokenPipeError,
|
||||
compat_getpass,
|
||||
compat_shlex_split,
|
||||
workaround_optparse_bug9161,
|
||||
@ -25,6 +26,7 @@ from .utils import (
|
||||
decodeOption,
|
||||
DEFAULT_OUTTMPL,
|
||||
DownloadError,
|
||||
error_to_compat_str,
|
||||
expand_path,
|
||||
match_filter_func,
|
||||
MaxDownloadsReached,
|
||||
@ -479,6 +481,12 @@ def main(argv=None):
|
||||
sys.exit('ERROR: fixed output name but more than one file to download')
|
||||
except KeyboardInterrupt:
|
||||
sys.exit('\nERROR: Interrupted by user')
|
||||
except compat_BrokenPipeError as err:
|
||||
# See "Note on SIGPIPE"
|
||||
# https://docs.python.org/3/library/signal.html#note-on-sigpipe
|
||||
devnull = os.open(os.devnull, os.O_WRONLY)
|
||||
os.dup2(devnull, sys.stdout.fileno())
|
||||
sys.exit('ERROR: %s' % error_to_compat_str(err))
|
||||
|
||||
|
||||
__all__ = ['main', 'YoutubeDL', 'gen_extractors', 'list_extractors']
|
||||
|
@ -3094,7 +3094,14 @@ else:
|
||||
return ctypes.WINFUNCTYPE(*args, **kwargs)
|
||||
|
||||
|
||||
try: # Python >= 3.3
|
||||
compat_BrokenPipeError = BrokenPipeError
|
||||
except NameError:
|
||||
compat_BrokenPipeError = IOError
|
||||
|
||||
|
||||
__all__ = [
|
||||
'compat_BrokenPipeError',
|
||||
'compat_HTMLParseError',
|
||||
'compat_HTMLParser',
|
||||
'compat_HTTPError',
|
||||
|
Loading…
x
Reference in New Issue
Block a user