Update YoutubeDL.py

This commit is contained in:
Sergey M 2017-06-03 19:11:32 +07:00 committed by GitHub
parent a8c92a9beb
commit 43b4a71b89

View File

@ -498,7 +498,8 @@ class YoutubeDL(object):
def to_console_title(self, message):
if not self.params.get('consoletitle', False):
return
if compat_os_name == 'nt' and ctypes.windll.kernel32.GetConsoleWindow():
if compat_os_name == 'nt':
if ctypes.windll.kernel32.GetConsoleWindow():
# c_wchar_p() might not be necessary if `message` is
# already of type unicode()
ctypes.windll.kernel32.SetConsoleTitleW(ctypes.c_wchar_p(message))