mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-08-20 13:24:16 -07:00
[compat] add compat_SimpleCookie
This commit is contained in:
parent
6beb1ac65b
commit
162bf9e10a
2 changed files with 12 additions and 6 deletions
|
@ -73,6 +73,15 @@ try:
|
|||
except ImportError: # Python 2
|
||||
import Cookie as compat_cookies
|
||||
|
||||
if sys.version_info[0] == 2:
|
||||
class compat_SimpleCookie(compat_cookies.SimpleCookie):
|
||||
def load(self, rawdata):
|
||||
if isinstance(rawdata, unicode):
|
||||
rawdata = str(rawdata)
|
||||
return super(compat_SimpleCookie, self).load(rawdata)
|
||||
else:
|
||||
compat_SimpleCookie = compat_cookies.SimpleCookie
|
||||
|
||||
try:
|
||||
import html.entities as compat_html_entities
|
||||
except ImportError: # Python 2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue