From dff63335f212d32d7c1a4bb5276f2d31f5995ea1 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Tue, 22 Dec 2015 14:09:50 +0000 Subject: Import python-urllib3_1.13.1.orig.tar.gz --- dummyserver/handlers.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'dummyserver/handlers.py') diff --git a/dummyserver/handlers.py b/dummyserver/handlers.py index 43398cd..fb6f44f 100644 --- a/dummyserver/handlers.py +++ b/dummyserver/handlers.py @@ -28,8 +28,8 @@ class Response(object): def __call__(self, request_handler): status, reason = self.status.split(' ', 1) request_handler.set_status(int(status), reason) - for header,value in self.headers: - request_handler.add_header(header,value) + for header, value in self.headers: + request_handler.add_header(header, value) # chunked if isinstance(self.body, list): @@ -48,6 +48,7 @@ class Response(object): RETRY_TEST_NAMES = collections.defaultdict(int) + class TestingApp(RequestHandler): """ Simple app that performs various operations, useful for testing an HTTP @@ -136,8 +137,8 @@ class TestingApp(RequestHandler): files_ = request.files.get(param) if len(files_) != 1: - return Response("Expected 1 file for '%s', not %d" %(param, len(files_)), - status='400 Bad Request') + return Response("Expected 1 file for '%s', not %d" % (param, len(files_)), + status='400 Bad Request') file_ = files_[0] data = file_['body'] @@ -277,7 +278,7 @@ def _parse_header(line): value = p[i + 1:].strip() params.append((name, value)) params = email.utils.decode_params(params) - params.pop(0) # get rid of the dummy again + params.pop(0) # get rid of the dummy again pdict = {} for name, value in params: value = email.utils.collapse_rfc2231_value(value) -- cgit v1.2.3