Remove unused code causing warnings
authorMagnus Hagander <magnus@hagander.net>
Wed, 1 Jan 2014 15:31:06 +0000 (16:31 +0100)
committerMagnus Hagander <magnus@hagander.net>
Wed, 1 Jan 2014 15:41:27 +0000 (16:41 +0100)
pgweb/account/admin.py
pgweb/account/forms.py
pgweb/core/forms.py
pgweb/core/views.py
pgweb/downloads/views.py
pgweb/search/views.py
pgweb/util/bases.py
tools/communityauth/sample/django/auth.py
tools/search/crawler/lib/parsers.py

index 41c47147f35c216babcba9963aeccd6f47d7dcdf..09b51b4c0cec4897ebd26e39fed91350dcdb0dc4 100644 (file)
@@ -13,7 +13,7 @@ class CommunityAuthSiteAdminForm(forms.ModelForm):
                x = None
                try:
                        x = base64.b64decode(self.cleaned_data['cryptkey'])
-               except TypeError, e:
+               except TypeError:
                        raise forms.ValidationError("Crypto key must be base64 encoded")
 
                if (len(x) != 16 and len(x) != 24 and len(x) != 32):
index a539551b9476e19d6437e619839b4b9a1325a9c2..8d715e99cdd7fc755f1aaa5f6af43eb6f7bc9b99 100644 (file)
@@ -31,7 +31,7 @@ class SignupForm(forms.Form):
                if not re.match('^[a-z0-9_@\.-]+$', username):
                        raise forms.ValidationError("Invalid character in user name. Only a-z, 0-9, _, @, . and - allowed.")
                try:
-                       u = User.objects.get(username=username)
+                       User.objects.get(username=username)
                except User.DoesNotExist:
                        return username
                raise forms.ValidationError("This username is already in use")
@@ -40,7 +40,7 @@ class SignupForm(forms.Form):
                email = self.cleaned_data['email']
 
                try:
-                       u = User.objects.get(email=email)
+                       User.objects.get(email=email)
                except User.DoesNotExist:
                        return email
                raise forms.ValidationError("A user with this email address is already registered")
index c781205c57770a3218889ee803cfba1cdb2a49cd..54337ff1894c081ae6f47eb0c670104d9c04835b 100644 (file)
@@ -24,7 +24,7 @@ class OrganisationForm(forms.ModelForm):
                if self.cleaned_data['add_manager']:
                        # Something was added as manager - let's make sure the user exists
                        try:
-                               u = User.objects.get(email=self.cleaned_data['add_manager'])
+                               User.objects.get(email=self.cleaned_data['add_manager'])
                        except User.DoesNotExist:
                                raise ValidationError("User with email %s not found" % self.cleaned_data['add_manager'])
 
index 826eae9216c802415ccf93ca233e5a30b6928a87..9369b4e54076744c3518c5262c46998eb1596f30 100644 (file)
@@ -95,10 +95,10 @@ def fallback(request, url):
 
        try:
                t = loader.get_template('pages/%s.html' % url)
-       except TemplateDoesNotExist, e:
+       except TemplateDoesNotExist:
                try:
                        t = loader.get_template('pages/%s/en.html' % url)
-               except TemplateDoesNotExist, e:
+               except TemplateDoesNotExist:
                        raise Http404('Page not found.')
                
        # Guestimate the nav section by looking at the URL and taking the first
index f45da9a1335e44010cf4eb3334bcb67fafdd929e..6e6b4987e798a34575d6df1769e3b6f55ba9c167 100644 (file)
@@ -112,7 +112,7 @@ def uploadftp(request):
                return HttpServerError("Invalid client address")
        # We have the data in request.raw_post_data. Attempt to load it as
        # a pickle to make sure it's properly formatted
-       throwaway = pickle.loads(request.raw_post_data)
+       pickle.loads(request.raw_post_data)
 
        # Next, check if it's the same as the current file
        f = open(settings.FTP_PICKLE, "rb")
index 46cad38dc331f0db06388ee61ff7c66d58deba85..ec8900b51b43f919016a7b2eb272d3e45190631b 100644 (file)
@@ -12,7 +12,7 @@ import psycopg2
 import simplejson as json
 import socket
 
-from lists.models import MailingList, MailingListGroup
+from lists.models import MailingList
 
 # Conditionally import memcached library. Everything will work without
 # it, so we allow development installs to run without it...
@@ -173,7 +173,7 @@ def search(request):
                        # behavior not supported on pylibmc in squeeze:: behaviors={'tcp_nodelay':True})
                        try:
                                hits = memc.get(urlstr)
-                       except Exception, e:
+                       except Exception:
                                # If we had an exception, don't try to store either
                                memc = None
                if not hits:
index 133c0ad690c85a9e371a13dcab3d4b49d49406a9..024fbdbc2c698781fab674aa3dd15c3a0174a40d 100644 (file)
@@ -75,7 +75,7 @@ class PgModel(object):
        def _get_changes_texts(self):
                try:
                        oldobj = self.__class__.objects.get(pk=self.pk)
-               except self.DoesNotExist, e:
+               except self.DoesNotExist:
                        return ('A new %s has been added' % self._meta.verbose_name, self.full_text_representation())
                if hasattr(self,'approved'):
                        # This object has the capability to do approving. Apply the following logic:
index 3f750b4a5d23d15e3a46e1176956ded26e2fa40a..88da19f5b65f14c28097ebcfe345a44eeef57b4c 100644 (file)
@@ -142,7 +142,7 @@ def auth_receive(request):
                s = decryptor.decrypt(base64.b64decode(datas, "-_")).rstrip(' ')
                try:
                        rdata = urlparse.parse_qs(s, strict_parsing=True)
-               except ValueError, e:
+               except ValueError:
                        raise Exception("Invalid encrypted data received.")
                if rdata.has_key('r'):
                        # Redirect address
index ef59cadb2dabbb71a385ed48e13481c4de6fe398..b1ad9c537574a877c4ff0d04b76d168998753657 100644 (file)
@@ -109,7 +109,7 @@ class ArchivesParser(object):
 
                try:
                        self.date = dateutil.parser.parse(d)
-               except ValueError, e:
+               except ValueError:
                        log("Failed to parse date '%s'" % d)
                        return False
 
@@ -147,7 +147,7 @@ class RobotsParser(object):
                                                activeagent = False
                                if activeagent and l.lower().startswith("disallow: "):
                                        self.disallows.append(l[10:])
-               except Exception, e:
+               except Exception:
                        self.disallows = []
 
        def block_url(self, url):