summaryrefslogtreecommitdiff
path: root/wsgitools/filters.py
diff options
context:
space:
mode:
Diffstat (limited to 'wsgitools/filters.py')
-rw-r--r--wsgitools/filters.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/wsgitools/filters.py b/wsgitools/filters.py
index 2a97066..7f8543d 100644
--- a/wsgitools/filters.py
+++ b/wsgitools/filters.py
@@ -15,7 +15,7 @@ import io
from wsgitools.internal import str2bytes
__all__.append("CloseableIterator")
-class CloseableIterator(object):
+class CloseableIterator:
"""Concatenating iterator with close attribute."""
def __init__(self, close_function, *iterators):
"""If close_function is not C{None}, it will be the C{close} attribute
@@ -40,8 +40,7 @@ class CloseableIterator(object):
except StopIteration:
self.iterators.pop(0)
return next(self)
- def next(self):
- return self.__next__()
+
__all__.append("CloseableList")
class CloseableList(list):
@@ -61,7 +60,7 @@ class CloseableList(list):
list.__iter__(self))
__all__.append("BaseWSGIFilter")
-class BaseWSGIFilter(object):
+class BaseWSGIFilter:
"""Generic WSGI filter class to be used with L{WSGIFilterMiddleware}.
For each request a filter object gets created.
@@ -138,7 +137,7 @@ class BaseWSGIFilter(object):
"""This method is invoked after the request has finished."""
__all__.append("WSGIFilterMiddleware")
-class WSGIFilterMiddleware(object):
+class WSGIFilterMiddleware:
"""This wsgi middleware can be used with specialized L{BaseWSGIFilter}s to
modify wsgi requests and/or reponses."""
def __init__(self, app, filterclass):
@@ -322,7 +321,7 @@ class TimerWSGIFilter(BaseWSGIFilter):
@rtype: bytes
"""
if data == self.pattern:
- return str2bytes("%8.3g" % (time.time() - self.start))
+ return b"%8.3g" % (time.time() - self.start)
return data
__all__.append("EncodeWSGIFilter")