Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

terrastate doesn't work with Python 3 #2

Open
beatcracker opened this issue Sep 26, 2018 · 0 comments
Open

terrastate doesn't work with Python 3 #2

beatcracker opened this issue Sep 26, 2018 · 0 comments

Comments

@beatcracker
Copy link

> python .\app.py

Traceback (most recent call last):
  File ".\app.py", line 154, in <module>
    app = TerraStateApi(__name__)
  File ".\app.py", line 137, in __init__
    for code in default_exceptions.iterkeys():
AttributeError: 'dict' object has no attribute 'iterkeys'

I've fixed this by replacing iterkeys with keys:

# add custom error handler
for code in default_exceptions.keys():
    self.register_error_handler(code, self.make_json_error)

I'm not sure how to make this fix backward compatible, so I just leave it here in case someone else encounters this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant