summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-04-21 18:00:57 +0200
committerVictor Stinner <victor.stinner@gmail.com>2015-04-21 18:00:57 +0200
commitb59a2dda5c597a87b001a7bb631581bf8d85939c (patch)
tree4feac77e8607ec8007661fe590a2958c886cb8b2
parentd9cdeaa58e1cd5628941e8bded9910feda86d2f3 (diff)
downloadpaste-git-b59a2dda5c597a87b001a7bb631581bf8d85939c.tar.gz
Port paste.lint to Python 3
* Expect bytes, not Unicode * Fix ErrorWrapper on Python 3: write() parameter must be bytes
-rw-r--r--paste/lint.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/paste/lint.py b/paste/lint.py
index fac8948..d781686 100644
--- a/paste/lint.py
+++ b/paste/lint.py
@@ -185,20 +185,20 @@ class InputWrapper(object):
def read(self, *args):
assert len(args) <= 1
v = self.input.read(*args)
- assert type(v) is type("")
+ assert isinstance(v, six.binary_type)
return v
def readline(self, *args):
v = self.input.readline(*args)
- assert type(v) is type("")
+ assert isinstance(v, six.binary_type)
return v
def readlines(self, *args):
assert len(args) <= 1
lines = self.input.readlines(*args)
- assert type(lines) is type([])
+ assert isinstance(lines, list)
for line in lines:
- assert type(line) is type("")
+ assert isinstance(line, six.binary_type)
return lines
def __iter__(self):
@@ -217,7 +217,7 @@ class ErrorWrapper(object):
self.errors = wsgi_errors
def write(self, s):
- assert type(s) is type("")
+ assert isinstance(s, bytes)
self.errors.write(s)
def flush(self):
@@ -236,7 +236,7 @@ class WriteWrapper(object):
self.writer = wsgi_writer
def __call__(self, s):
- assert type(s) is type("")
+ assert isinstance(s, six.binary_type)
self.writer(s)
class PartialIteratorWrapper(object):