Skip to content

terrastate doesn't work with Python 3 #2

@beatcracker

Description

@beatcracker
> 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions