mirror of
https://github.com/ytdl-org/youtube-dl
synced 2025-10-02 14:28:36 +09:00
[compat] add compat_SimpleCookie
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user