diff --git a/jira/utils/__init__.py b/jira/utils/__init__.py index 0de4b91b8..a3b94997b 100644 --- a/jira/utils/__init__.py +++ b/jira/utils/__init__.py @@ -36,13 +36,14 @@ class CaseInsensitiveDict(dict): def __init__(self, *args, **kw): super(CaseInsensitiveDict, self).__init__(*args, **kw) - self.itemlist = {} - for key, value in super(CaseInsensitiveDict, self).items(): + upper_keys_list = [] + for key in super(CaseInsensitiveDict, self).keys(): if key != key.lower(): - self[key.lower()] = value - self.pop(key, None) + upper_keys_list.append(key) - # self.itemlist[key.lower()] = value + for upper_key in upper_keys_list: + self[upper_key.lower()] = self[upper_key] + self.pop(upper_key, None) def __setitem__(self, key, value): """Overwrite [] implementation."""