aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/src/Lib/wsgiref
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.ru>2022-02-10 16:44:39 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:44:39 +0300
commite9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (patch)
tree64175d5cadab313b3e7039ebaa06c5bc3295e274 /contrib/tools/python3/src/Lib/wsgiref
parent2598ef1d0aee359b4b6d5fdd1758916d5907d04f (diff)
downloadydb-e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0.tar.gz
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/tools/python3/src/Lib/wsgiref')
-rw-r--r--contrib/tools/python3/src/Lib/wsgiref/handlers.py32
-rw-r--r--contrib/tools/python3/src/Lib/wsgiref/simple_server.py4
-rw-r--r--contrib/tools/python3/src/Lib/wsgiref/util.py20
-rw-r--r--contrib/tools/python3/src/Lib/wsgiref/validate.py4
4 files changed, 30 insertions, 30 deletions
diff --git a/contrib/tools/python3/src/Lib/wsgiref/handlers.py b/contrib/tools/python3/src/Lib/wsgiref/handlers.py
index 0837493c52..31360e5878 100644
--- a/contrib/tools/python3/src/Lib/wsgiref/handlers.py
+++ b/contrib/tools/python3/src/Lib/wsgiref/handlers.py
@@ -136,10 +136,10 @@ class BaseHandler:
self.setup_environ()
self.result = application(self.environ, self.start_response)
self.finish_response()
- except (ConnectionAbortedError, BrokenPipeError, ConnectionResetError):
- # We expect the client to close the connection abruptly from time
- # to time.
- return
+ except (ConnectionAbortedError, BrokenPipeError, ConnectionResetError):
+ # We expect the client to close the connection abruptly from time
+ # to time.
+ return
except:
try:
self.handle_error()
@@ -183,16 +183,16 @@ class BaseHandler:
for data in self.result:
self.write(data)
self.finish_content()
- except:
- # Call close() on the iterable returned by the WSGI application
- # in case of an exception.
- if hasattr(self.result, 'close'):
- self.result.close()
- raise
- else:
- # We only call close() when no exception is raised, because it
- # will set status, result, headers, and environ fields to None.
- # See bpo-29183 for more details.
+ except:
+ # Call close() on the iterable returned by the WSGI application
+ # in case of an exception.
+ if hasattr(self.result, 'close'):
+ self.result.close()
+ raise
+ else:
+ # We only call close() when no exception is raised, because it
+ # will set status, result, headers, and environ fields to None.
+ # See bpo-29183 for more details.
self.close()
@@ -246,8 +246,8 @@ class BaseHandler:
for name, val in headers:
name = self._convert_string_type(name, "Header name")
val = self._convert_string_type(val, "Header value")
- assert not is_hop_by_hop(name),\
- f"Hop-by-hop header, '{name}: {val}', not allowed"
+ assert not is_hop_by_hop(name),\
+ f"Hop-by-hop header, '{name}: {val}', not allowed"
return self.write
diff --git a/contrib/tools/python3/src/Lib/wsgiref/simple_server.py b/contrib/tools/python3/src/Lib/wsgiref/simple_server.py
index aff668b662..93d01a863a 100644
--- a/contrib/tools/python3/src/Lib/wsgiref/simple_server.py
+++ b/contrib/tools/python3/src/Lib/wsgiref/simple_server.py
@@ -127,8 +127,8 @@ class WSGIRequestHandler(BaseHTTPRequestHandler):
return
handler = ServerHandler(
- self.rfile, self.wfile, self.get_stderr(), self.get_environ(),
- multithread=False,
+ self.rfile, self.wfile, self.get_stderr(), self.get_environ(),
+ multithread=False,
)
handler.request_handler = self # backpointer for logging
handler.run(self.server.get_app())
diff --git a/contrib/tools/python3/src/Lib/wsgiref/util.py b/contrib/tools/python3/src/Lib/wsgiref/util.py
index 53faf6a213..cac52eb5a5 100644
--- a/contrib/tools/python3/src/Lib/wsgiref/util.py
+++ b/contrib/tools/python3/src/Lib/wsgiref/util.py
@@ -18,13 +18,13 @@ class FileWrapper:
self.close = filelike.close
def __getitem__(self,key):
- import warnings
- warnings.warn(
- "FileWrapper's __getitem__ method ignores 'key' parameter. "
- "Use iterator protocol instead.",
- DeprecationWarning,
- stacklevel=2
- )
+ import warnings
+ warnings.warn(
+ "FileWrapper's __getitem__ method ignores 'key' parameter. "
+ "Use iterator protocol instead.",
+ DeprecationWarning,
+ stacklevel=2
+ )
data = self.filelike.read(self.blksize)
if data:
return data
@@ -162,9 +162,9 @@ def setup_testing_defaults(environ):
_hoppish = {
- 'connection', 'keep-alive', 'proxy-authenticate',
- 'proxy-authorization', 'te', 'trailers', 'transfer-encoding',
- 'upgrade'
+ 'connection', 'keep-alive', 'proxy-authenticate',
+ 'proxy-authorization', 'te', 'trailers', 'transfer-encoding',
+ 'upgrade'
}.__contains__
def is_hop_by_hop(header_name):
diff --git a/contrib/tools/python3/src/Lib/wsgiref/validate.py b/contrib/tools/python3/src/Lib/wsgiref/validate.py
index 73b09e3cec..6e16578dbb 100644
--- a/contrib/tools/python3/src/Lib/wsgiref/validate.py
+++ b/contrib/tools/python3/src/Lib/wsgiref/validate.py
@@ -77,7 +77,7 @@ Some of the things this checks:
* That wsgi.input is used properly:
- - .read() is called with exactly one argument
+ - .read() is called with exactly one argument
- That it returns a string
@@ -137,7 +137,7 @@ def validator(application):
"""
When applied between a WSGI server and a WSGI application, this
- middleware will check for WSGI compliance on a number of levels.
+ middleware will check for WSGI compliance on a number of levels.
This middleware does not modify the request or response in any
way, but will raise an AssertionError if anything seems off
(except for a failure to close the application iterator, which