Skip to content

Commit

Permalink
Merge pull request #46 from mgaitan/py3
Browse files Browse the repository at this point in the history
add python 3 compatibility. all tests pass
  • Loading branch information
coleifer committed Apr 2, 2015
2 parents 40a3296 + fccef47 commit 5572ba7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions micawber/providers.py
Expand Up @@ -74,7 +74,11 @@ def handle_response(self, response, url):
try:
json_data = json.loads(response)
except InvalidJson as exc:
raise InvalidResponseException(exc.message)
try:
msg = exc.message
except AttributeError:
msg = exc.args[0]
raise InvalidResponseException(msg)

if 'url' not in json_data:
json_data['url'] = url
Expand Down Expand Up @@ -126,7 +130,7 @@ def unregister(self, regex):
del self._registry[regex]

def __iter__(self):
return iter(reversed(self._registry.items()))
return iter(reversed(list(self._registry.items())))

def provider_for_url(self, url):
for regex, provider in self:
Expand Down

0 comments on commit 5572ba7

Please sign in to comment.