Skip to content

Commit

Permalink
Fixed ability to turn off caching
Browse files Browse the repository at this point in the history
(cherry picked from commit e66164b)
  • Loading branch information
jc committed Nov 14, 2010
1 parent 045a99b commit 1ca8a7a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lastfm/api.py
Expand Up @@ -65,7 +65,6 @@ def __init__(self,
self._api_key = api_key
self._secret = secret
self._session_key = session_key
self._cache = FileCache()
self._urllib = urllib2
self._cache_timeout = Api.DEFAULT_CACHE_TIMEOUT
self._initialize_request_headers(request_headers)
Expand All @@ -74,6 +73,10 @@ def __init__(self,
self._no_cache = no_cache
self._logfile = logfile
self._last_fetch_time = datetime.now()
if self._no_cache:
self._cache = None
else:
self._cache = FileCache()

if debug is not None:
if debug in Api.DEBUG_LEVELS:
Expand Down

0 comments on commit 1ca8a7a

Please sign in to comment.