Fix bug updating WeakKeyDictionary during iteration #1698

Merged
merged 1 commit into from Feb 17, 2013

3 participants

@mdboom
Matplotlib Developers member

This is an attempt to fix the bug reported in the mailing list thread "BUG: RuntimeError: dictionary changed size during iteration".

@mdboom mdboom Fix itervalues -> values. As reported by Massimiliano Costacurta in m…
…ailing list thread "BUG: RuntimeError: dictionary changed size during iteration"
09ca7c2
@pelson
Matplotlib Developers member

Does this fix the problem?

View changed from a copy to a view between python2.7 and python3.2. Maybe 2to3 handles this magic?

http://docs.python.org/2.7/library/stdtypes.html?highlight=dict#dict.values
http://docs.python.org/3.2/library/stdtypes.html?highlight=dict#dict.values

@mdboom
Matplotlib Developers member

Yes -- 2to3 converts dict.values() into list(dict.values())

@efiring efiring merged commit 610b182 into matplotlib:v1.2.x Feb 17, 2013

1 check failed

Details default The Travis build failed
@mdboom mdboom deleted the mdboom:iteritems_bug branch Aug 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment