Skip to content
This repository has been archived by the owner on Dec 9, 2019. It is now read-only.

Commit

Permalink
Fix flake8 lambda complaint
Browse files Browse the repository at this point in the history
  • Loading branch information
adamcik committed Jan 24, 2016
1 parent e1198ff commit 2be3f1c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mopidy_dirble/client.py
Expand Up @@ -14,6 +14,10 @@
logger = logging.getLogger(__name__)


def _normalize_keys(data):
return {k.lower(): v for k, v in data.items()}


class Dirble(object):
"""Light wrapper for Dirble API lookup.
Expand Down Expand Up @@ -140,8 +144,7 @@ def _fetch(self, path, default):

# Get succeeded, convert JSON, normalize and return.
if resp.status_code == 200:
normalize_keys = lambda d: {k.lower(): v for k, v in d.items()}
data = resp.json(object_hook=normalize_keys)
data = resp.json(object_hook=_normalize_keys)
self._cache[uri] = data
self._backoff = 1
return data
Expand Down

0 comments on commit 2be3f1c

Please sign in to comment.