From c8b94e0067449711424d7b9c70cb97cf3837d596 Mon Sep 17 00:00:00 2001 From: James Socol Date: Mon, 17 Sep 2012 15:13:29 -0400 Subject: [PATCH] PEP8 and Pyflakes cleanup. --- commonware/exceptions/middleware.py | 11 ----------- commonware/request/middleware.py | 1 + commonware/response/cookies/tests.py | 1 - 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/commonware/exceptions/middleware.py b/commonware/exceptions/middleware.py index d5eca3e..ee82ad2 100644 --- a/commonware/exceptions/middleware.py +++ b/commonware/exceptions/middleware.py @@ -21,14 +21,3 @@ def process_exception(self, request, exception): # Clearing out all cookies in request.META. They will already # be sent with request.COOKIES. request.META['HTTP_COOKIE'] = '******' - - -class HidePasswordOnException(ScrubRequestOnException): - def __init__(self): - import warnings - warnings.warn( - "The middleware at `commonware.middleware.HidePasswordOnException` " - "is deprecated; use `commonware.middleware.ScrubRequestOnException` " - "instead.", - DeprecationWarning - ) diff --git a/commonware/request/middleware.py b/commonware/request/middleware.py index 9d0f49b..dd9abcb 100644 --- a/commonware/request/middleware.py +++ b/commonware/request/middleware.py @@ -4,6 +4,7 @@ TYPES = (socket.AF_INET, socket.AF_INET6) + def is_valid(ip): for af in TYPES: try: diff --git a/commonware/response/cookies/tests.py b/commonware/response/cookies/tests.py index f56c34e..b718ccf 100644 --- a/commonware/response/cookies/tests.py +++ b/commonware/response/cookies/tests.py @@ -1,6 +1,5 @@ from django.http import HttpResponse from mock import patch -from nose.tools import eq_ from commonware.response.cookies.monkeypatch import patch_all