diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-04-21 18:00:57 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-04-21 18:00:57 +0200 |
commit | 7fb1d04880da53aeebd94dec9e4f67e3bf631c2a (patch) | |
tree | 4feac77e8607ec8007661fe590a2958c886cb8b2 /paste/lint.py | |
parent | 2da92d0414dfa6a9f13690e24a84440a2e61fa93 (diff) | |
download | paste-7fb1d04880da53aeebd94dec9e4f67e3bf631c2a.tar.gz |
Port paste.lint to Python 3
* Expect bytes, not Unicode
* Fix ErrorWrapper on Python 3: write() parameter must be bytes
Diffstat (limited to 'paste/lint.py')
-rw-r--r-- | paste/lint.py | 12 |
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): |