diff --git a/netlib/basetypes.py b/netlib/basetypes.py index d03246ff1..9d6c60ba1 100644 --- a/netlib/basetypes.py +++ b/netlib/basetypes.py @@ -1,6 +1,7 @@ import six import abc + @six.add_metaclass(abc.ABCMeta) class Serializable(object): """ diff --git a/netlib/http/headers.py b/netlib/http/headers.py index 8f669ec17..fa7b71808 100644 --- a/netlib/http/headers.py +++ b/netlib/http/headers.py @@ -176,7 +176,7 @@ class Headers(MultiDict): self.fields = fields return replacements - + def parse_content_type(c): """ A simple parser for content-type values. Returns a (type, subtype, diff --git a/netlib/http/url.py b/netlib/http/url.py index 147ed5725..8ce28578b 100644 --- a/netlib/http/url.py +++ b/netlib/http/url.py @@ -3,6 +3,7 @@ from six.moves import urllib from .. import utils + # PY2 workaround def decode_parse_result(result, enc): if hasattr(result, "decode"): diff --git a/netlib/human.py b/netlib/human.py index 9eccd35b5..a007adc78 100644 --- a/netlib/human.py +++ b/netlib/human.py @@ -19,7 +19,7 @@ def pretty_size(size): if x == int(x): x = int(x) return str(x) + suf - return "%s%s"%(size, SIZE_TABLE[0][0]) + return "%s%s" % (size, SIZE_TABLE[0][0]) def parse_size(s): diff --git a/netlib/utils.py b/netlib/utils.py index 6be1c17f3..b8408d1d0 100644 --- a/netlib/utils.py +++ b/netlib/utils.py @@ -8,6 +8,7 @@ import inspect import six + def always_bytes(unicode_or_bytes, *encode_args): if isinstance(unicode_or_bytes, six.text_type): return unicode_or_bytes.encode(*encode_args) diff --git a/test/netlib/http/test_multipart.py b/test/netlib/http/test_multipart.py index 45ae996b6..1d7e00620 100644 --- a/test/netlib/http/test_multipart.py +++ b/test/netlib/http/test_multipart.py @@ -1,6 +1,7 @@ from netlib.http import Headers from netlib.http import multipart + def test_decode(): boundary = 'somefancyboundary' headers = Headers( diff --git a/test/netlib/http/test_url.py b/test/netlib/http/test_url.py index 697c83a81..26b37230e 100644 --- a/test/netlib/http/test_url.py +++ b/test/netlib/http/test_url.py @@ -1,6 +1,7 @@ from netlib import tutils from netlib.http import url + def test_parse(): with tutils.raises(ValueError): url.parse("") diff --git a/test/netlib/test_basetypes.py b/test/netlib/test_basetypes.py index 2a7eea818..aa4157849 100644 --- a/test/netlib/test_basetypes.py +++ b/test/netlib/test_basetypes.py @@ -1,5 +1,6 @@ from netlib import basetypes + class SerializableDummy(basetypes.Serializable): def __init__(self, i): self.i = i diff --git a/test/netlib/test_human.py b/test/netlib/test_human.py index 464d46468..2a5c2a854 100644 --- a/test/netlib/test_human.py +++ b/test/netlib/test_human.py @@ -1,5 +1,6 @@ from netlib import human, tutils + def test_parse_size(): assert human.parse_size("0") == 0 assert human.parse_size("0b") == 0