Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Commit

Permalink
support python 2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen Short committed Oct 31, 2012
1 parent 0dbeea5 commit b4ca832
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions mkt/webapps/tasks.py
@@ -1,4 +1,3 @@
import collections
import hashlib
import json
import logging
Expand Down Expand Up @@ -62,7 +61,7 @@ def update_manifests(ids, **kw):
task_log.info('[%s@%s] Update manifests.' %
(len(ids), update_manifests.rate_limit))
check_hash = kw.pop('check_hash', True)
retries = collections.Counter(kw.pop('retries', {}))
retries = kw.pop('retries', {})
# Since we'll be logging the updated manifest change to the users log,
# we'll need to log in as user.
amo.set_user(get_task_user())
Expand Down Expand Up @@ -93,7 +92,7 @@ def _update_manifest(id, check_hash, failed_fetches):
msg = u'Failed to get manifest from %s. Error: %s' % (
webapp.manifest_url, e.message)
_log(webapp, msg, rereview=True, exc_info=True)
failed_fetches[id] += 1
failed_fetches[id] = failed_fetches.get(id, 0) + 1
if failed_fetches[id] >= 3:
_log(webapp, msg, rereview=True, exc_info=True)
RereviewQueue.flag(webapp, amo.LOG.REREVIEW_MANIFEST_CHANGE, msg)
Expand Down
3 changes: 1 addition & 2 deletions mkt/webapps/tests/test_tasks.py
@@ -1,4 +1,3 @@
from collections import Counter
import json
import os

Expand Down Expand Up @@ -186,7 +185,7 @@ def die(self):
retry.assert_called_with(
args=([self.addon.pk,],),
kwargs={'check_hash': True,
'retries': Counter({self.addon.pk: 1})},
'retries': {self.addon.pk: 1}},
countdown=3600)

@mock.patch('mkt.webapps.tasks._fetch_manifest')
Expand Down

0 comments on commit b4ca832

Please sign in to comment.