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/wsgi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'netlib/wsgi.py') diff --git a/netlib/wsgi.py b/netlib/wsgi.py index d6dfae5d..e1259cba 100644 --- a/netlib/wsgi.py +++ b/netlib/wsgi.py @@ -1,5 +1,5 @@ from __future__ import (absolute_import, print_function, division) -from io import BytesIO, StringIO +from io import BytesIO import urllib import time import traceback @@ -154,7 +154,7 @@ class WSGIAdaptor(object): write(i) if not state["headers_sent"]: write(b"") - except Exception as e: + except Exception: try: s = traceback.format_exc() errs.write(s.encode("utf-8", "replace")) -- 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/wsgi.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'netlib/wsgi.py') diff --git a/netlib/wsgi.py b/netlib/wsgi.py index e1259cba..cde562f8 100644 --- a/netlib/wsgi.py +++ b/netlib/wsgi.py @@ -1,15 +1,15 @@ from __future__ import (absolute_import, print_function, division) -from io import BytesIO -import urllib + import time import traceback - import six +from io import BytesIO from six.moves import urllib from netlib.utils import always_bytes, native from . import http, tcp + class ClientConn(object): def __init__(self, address): @@ -140,7 +140,7 @@ class WSGIAdaptor(object): elif state["status"]: raise AssertionError('Response already started') state["status"] = status - state["headers"] = http.Headers([[always_bytes(k), always_bytes(v)] for k,v in headers]) + state["headers"] = http.Headers([[always_bytes(k), always_bytes(v)] for k, v in headers]) if exc_info: self.error_page(soc, state["headers_sent"], traceback.format_tb(exc_info[2])) state["headers_sent"] = True -- cgit v1.2.3