pallets-eco / flask-environments

Environment tools and configuration for Flask applications
MIT License
30 stars 15 forks source link

AttributeError: 'dict' object has no attribute 'iterkeys' #7

Open BorisIvanov opened 10 years ago

BorisIvanov commented 10 years ago

in python 3.4.1 error AttributeError: 'dict' object has no attribute 'iterkeys' row 59 - for key in c.iterkeys():

BorisIvanov commented 10 years ago

need write for key in c

photuris commented 9 years ago

Came here to confirm. for key in c: fixes the issue for Python 3.

MartinThoma commented 9 years ago
Python 2.7.8 (default, Oct 20 2014, 15:05:19)
[GCC 4.9.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> c = {'a': 1, 'b': 2, 'c': 3}
>>> for key in c: print(key)
...
a
c
b
>>> for key in c.keys(): print(key)
...
a
c
b
>>> for key in c.iterkeys(): print(key)
...
a
c
b

Python 3.4.2 (default, Oct  8 2014, 13:08:17)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> c = {'a': 1, 'b': 2, 'c': 3}
>>> for key in c: print(key)
...
b
a
c
>>> for key in c.keys(): print(key)
...
b
a
c
>>> for key in c.iterkeys(): print(key)
...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'dict' object has no attribute 'iterkeys'
>>>
ardinusawan commented 7 years ago

So this problem not resolve, yet? ._. I resolve this with manually edit library from c.iterkeys() to c.keys()

colinpollock commented 7 years ago

Is this library meant to work in python3?