mirror of
https://github.com/cooperhammond/irs.git
synced 2025-02-27 23:16:46 +00:00
python 3 compatibility
This commit is contained in:
parent
6ec1de6251
commit
2da9ec6093
10
irs/utils.py
10
irs/utils.py
|
@ -58,11 +58,11 @@ class YdlUtils:
|
|||
|
||||
def set_utf8_encoding(ld): # ld => a list or dictionary with strings in it
|
||||
if type(ld) == dict:
|
||||
for k, v in ld.iteritems():
|
||||
if type(v) == dict or type(v) == list:
|
||||
ld[k] = set_utf8_encoding(v)
|
||||
elif type(v) == str:
|
||||
ld[k] = v.encode('utf-8')
|
||||
for k in ld:
|
||||
if type(ld[k]) == dict or type(ld[k]) == list:
|
||||
ld[k] = set_utf8_encoding(ld[k])
|
||||
elif type(ld[k]) == str:
|
||||
ld[k] = ld[k].encode('utf-8')
|
||||
elif type(ld) == list:
|
||||
for index, datum in enumerate(ld):
|
||||
if type(datum) == str:
|
||||
|
|
Loading…
Reference in a new issue