[cleanup] Refactor updater
The updater now uses `.update.run_update` and not `.update.update_self`. Although I don't expect anyone to be using the updater via API, a wrapper `update_self` is provided for compatibility just in case
This commit is contained in:
parent
5435dcf96e
commit
c19bc311cb
3 changed files with 75 additions and 70 deletions
|
|
@ -37,7 +37,7 @@ from .utils import (
|
|||
std_headers,
|
||||
write_string,
|
||||
)
|
||||
from .update import update_self
|
||||
from .update import run_update
|
||||
from .downloader import (
|
||||
FileDownloader,
|
||||
)
|
||||
|
|
@ -663,7 +663,7 @@ def _real_main(argv=None):
|
|||
# Update version
|
||||
if opts.update_self:
|
||||
# If updater returns True, exit. Required for windows
|
||||
if update_self(ydl.to_screen, opts.verbose, ydl._opener):
|
||||
if run_update(ydl):
|
||||
if actual_use:
|
||||
sys.exit('ERROR: The program must exit for the update to complete')
|
||||
sys.exit()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue