From caee1adeb613368dc658bfc0c99e445d6f41cd7c Mon Sep 17 00:00:00 2001 From: Thomas Kriechbaumer Date: Sat, 28 May 2016 14:36:43 +0200 Subject: cleanup imports with flake8 --- netlib/http/message.py | 1 - 1 file changed, 1 deletion(-) (limited to 'netlib/http/message.py') diff --git a/netlib/http/message.py b/netlib/http/message.py index 028f43a1..b7f42515 100644 --- a/netlib/http/message.py +++ b/netlib/http/message.py @@ -4,7 +4,6 @@ import warnings import six -from ..multidict import MultiDict from .headers import Headers from .. import encoding, utils -- cgit v1.2.3 From e5038c9ab7a6718e7a3408a43549231929c7beb9 Mon Sep 17 00:00:00 2001 From: Thomas Kriechbaumer Date: Sat, 28 May 2016 22:17:02 +0200 Subject: netlib: fix most flake8 offenses --- netlib/http/message.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'netlib/http/message.py') diff --git a/netlib/http/message.py b/netlib/http/message.py index b7f42515..13d401a7 100644 --- a/netlib/http/message.py +++ b/netlib/http/message.py @@ -6,14 +6,21 @@ import six from .headers import Headers from .. import encoding, utils +from ..utils import always_bytes if six.PY2: # pragma: no cover - _native = lambda x: x - _always_bytes = lambda x: x + def _native(x): + return x + + def _always_bytes(x): + return x else: - # While the HTTP head _should_ be ASCII, it's not uncommon for certain headers to be utf-8 encoded. - _native = lambda x: x.decode("utf-8", "surrogateescape") - _always_bytes = lambda x: utils.always_bytes(x, "utf-8", "surrogateescape") + # While headers _should_ be ASCII, it's not uncommon for certain headers to be utf-8 encoded. + def _native(x): + return x.decode("utf-8", "surrogateescape") + + def _always_bytes(x): + return always_bytes(x, "utf-8", "surrogateescape") class MessageData(utils.Serializable): -- cgit v1.2.3