mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-08-14 02:27:42 -07:00
[utils, etc] Kill child processes when yt-dl is killed
* derived from PR #26592, closes #26592 Authored by: Unrud
This commit is contained in:
parent
811c480f7b
commit
0700fde640
8 changed files with 42 additions and 21 deletions
|
@ -73,6 +73,7 @@ from .utils import (
|
|||
PostProcessingError,
|
||||
preferredencoding,
|
||||
prepend_extension,
|
||||
process_communicate_or_kill,
|
||||
register_socks_protocols,
|
||||
render_table,
|
||||
replace_extension,
|
||||
|
@ -2323,7 +2324,7 @@ class YoutubeDL(object):
|
|||
['git', 'rev-parse', '--short', 'HEAD'],
|
||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
||||
cwd=os.path.dirname(os.path.abspath(__file__)))
|
||||
out, err = sp.communicate()
|
||||
out, err = process_communicate_or_kill(sp)
|
||||
out = out.decode().strip()
|
||||
if re.match('[0-9a-f]+', out):
|
||||
self._write_string('[debug] Git HEAD: ' + out + '\n')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue