aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/src/Lib/wsgiref/handlers.py
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/handlers.py
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/handlers.py')
-rw-r--r--contrib/tools/python3/src/Lib/wsgiref/handlers.py32
1 files changed, 16 insertions, 16 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