[cookies] Fix compatibility for Python <=3.9 in traceback

Authored by: Grub4K
pull/11236/head
Simon Sawicki 3 months ago committed by GitHub
parent babb709605
commit c5f0f58efd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -4120,7 +4120,8 @@ class YoutubeDL:
self.params.get('cookiefile'), self.params.get('cookiesfrombrowser'), self)
except CookieLoadError as error:
cause = error.__context__
self.report_error(str(cause), tb=''.join(traceback.format_exception(cause)))
# compat: <=py3.9: `traceback.format_exception` has a different signature
self.report_error(str(cause), tb=''.join(traceback.format_exception(None, cause, cause.__traceback__)))
raise
@property

Loading…
Cancel
Save