diff --git a/modernize/fixes/fix_dict_six.py b/modernize/fixes/fix_dict_six.py index 7de96cf..e5df914 100644 --- a/modernize/fixes/fix_dict_six.py +++ b/modernize/fixes/fix_dict_six.py @@ -43,9 +43,3 @@ def transform(self, node, results): return super().transform(node, results) else: return self.transform_iter(node, results) - - def in_special_context(self, node, isiter): - # Redefined from parent class to make "for x in d.items()" count as - # in special context; fissix only counts for loops as special context - # for the iter* methods. - return super().in_special_context(node, True) diff --git a/tests/test_fix_dict_six.py b/tests/test_fix_dict_six.py index 950941e..a248bec 100644 --- a/tests/test_fix_dict_six.py +++ b/tests/test_fix_dict_six.py @@ -38,11 +38,11 @@ DICT_IN_LOOP = ( """\ for k in x.items(): - pass + del x[k] """, """\ -for k in x.items(): - pass +for k in list(x.items()): + del x[k] """, )