From 2da9ec6093943440b408f88b7f9ea51ee8ce020a Mon Sep 17 00:00:00 2001 From: Kepoor Hampond Date: Mon, 5 Jun 2017 19:37:16 -0700 Subject: [PATCH] python 3 compatibility --- irs/utils.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/irs/utils.py b/irs/utils.py index 4d78271..a3a1cd6 100644 --- a/irs/utils.py +++ b/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: