bpo-33694: Fix typo in helper function name (GH-7522)

_feed_data_to_bufferred_proto() renamed to
_feed_data_to_buffered_proto() ("bufferred" => "buffered").

Typo spotted by Nathaniel J. Smith.
(cherry picked from commit ff6c077292)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
This commit is contained in:
Miss Islington (bot) 2018-06-08 01:48:50 -07:00 committed by GitHub
parent 76bef61b41
commit 17beebcc8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 9 deletions

View File

@ -234,7 +234,7 @@ class _ProactorReadPipeTransport(_ProactorBasePipeTransport,
if isinstance(self._protocol, protocols.BufferedProtocol): if isinstance(self._protocol, protocols.BufferedProtocol):
try: try:
protocols._feed_data_to_bufferred_proto(self._protocol, data) protocols._feed_data_to_buffered_proto(self._protocol, data)
except Exception as exc: except Exception as exc:
self._fatal_error(exc, self._fatal_error(exc,
'Fatal error: protocol.buffer_updated() ' 'Fatal error: protocol.buffer_updated() '

View File

@ -191,7 +191,7 @@ class SubprocessProtocol(BaseProtocol):
"""Called when subprocess has exited.""" """Called when subprocess has exited."""
def _feed_data_to_bufferred_proto(proto, data): def _feed_data_to_buffered_proto(proto, data):
data_len = len(data) data_len = len(data)
while data_len: while data_len:
buf = proto.get_buffer(data_len) buf = proto.get_buffer(data_len)

View File

@ -535,7 +535,7 @@ class SSLProtocol(protocols.Protocol):
if chunk: if chunk:
try: try:
if self._app_protocol_is_buffer: if self._app_protocol_is_buffer:
protocols._feed_data_to_bufferred_proto( protocols._feed_data_to_buffered_proto(
self._app_protocol, chunk) self._app_protocol, chunk)
else: else:
self._app_protocol.data_received(chunk) self._app_protocol.data_received(chunk)

View File

@ -186,28 +186,28 @@ class BaseStartTLS(func_tests.FunctionalTestCaseMixin):
for usemv in [False, True]: for usemv in [False, True]:
proto = Proto(1, usemv) proto = Proto(1, usemv)
protocols._feed_data_to_bufferred_proto(proto, b'12345') protocols._feed_data_to_buffered_proto(proto, b'12345')
self.assertEqual(proto.data, b'12345') self.assertEqual(proto.data, b'12345')
proto = Proto(2, usemv) proto = Proto(2, usemv)
protocols._feed_data_to_bufferred_proto(proto, b'12345') protocols._feed_data_to_buffered_proto(proto, b'12345')
self.assertEqual(proto.data, b'12345') self.assertEqual(proto.data, b'12345')
proto = Proto(2, usemv) proto = Proto(2, usemv)
protocols._feed_data_to_bufferred_proto(proto, b'1234') protocols._feed_data_to_buffered_proto(proto, b'1234')
self.assertEqual(proto.data, b'1234') self.assertEqual(proto.data, b'1234')
proto = Proto(4, usemv) proto = Proto(4, usemv)
protocols._feed_data_to_bufferred_proto(proto, b'1234') protocols._feed_data_to_buffered_proto(proto, b'1234')
self.assertEqual(proto.data, b'1234') self.assertEqual(proto.data, b'1234')
proto = Proto(100, usemv) proto = Proto(100, usemv)
protocols._feed_data_to_bufferred_proto(proto, b'12345') protocols._feed_data_to_buffered_proto(proto, b'12345')
self.assertEqual(proto.data, b'12345') self.assertEqual(proto.data, b'12345')
proto = Proto(0, usemv) proto = Proto(0, usemv)
with self.assertRaisesRegex(RuntimeError, 'empty buffer'): with self.assertRaisesRegex(RuntimeError, 'empty buffer'):
protocols._feed_data_to_bufferred_proto(proto, b'12345') protocols._feed_data_to_buffered_proto(proto, b'12345')
def test_start_tls_client_reg_proto_1(self): def test_start_tls_client_reg_proto_1(self):
HELLO_MSG = b'1' * self.PAYLOAD_SIZE HELLO_MSG = b'1' * self.PAYLOAD_SIZE