diff --git a/django_website/aggregator/management/commands/mark_defunct_feeds.py b/django_website/aggregator/management/commands/mark_defunct_feeds.py index 20829cf8d..ba57a9e53 100644 --- a/django_website/aggregator/management/commands/mark_defunct_feeds.py +++ b/django_website/aggregator/management/commands/mark_defunct_feeds.py @@ -1,5 +1,6 @@ import socket import urllib2 +import httplib from django.core.management.base import BaseCommand from django_website.aggregator.models import Feed @@ -10,8 +11,9 @@ class Command(BaseCommand): def handle(self, *args, **kwargs): for f in Feed.objects.filter(is_defunct=False): try: - r = urllib2.urlopen(f.feed_url, timeout=15) - except (urllib2.HTTPError, urllib2.URLError, socket.timeout), e: + urllib2.urlopen(f.feed_url, timeout=15) + except (urllib2.HTTPError, urllib2.URLError, httplib.HTTPException, + socket.timeout), e: print "%s on '%s'; marking defunct" % (e, f) f.is_defunct = True f.save() \ No newline at end of file