Skip to content

Commit

Permalink
bpo-33694: Fix typo in helper function name (GH-7522)
Browse files Browse the repository at this point in the history
_feed_data_to_bufferred_proto() renamed to
_feed_data_to_buffered_proto() ("bufferred" => "buffered").

Typo spotted by Nathaniel J. Smith.
  • Loading branch information
vstinner authored Jun 8, 2018
1 parent c45fc76 commit ff6c077
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Lib/asyncio/proactor_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def _data_received(self, data):

if isinstance(self._protocol, protocols.BufferedProtocol):
try:
protocols._feed_data_to_bufferred_proto(self._protocol, data)
protocols._feed_data_to_buffered_proto(self._protocol, data)
except Exception as exc:
self._fatal_error(exc,
'Fatal error: protocol.buffer_updated() '
Expand Down
2 changes: 1 addition & 1 deletion Lib/asyncio/protocols.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def process_exited(self):
"""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)
while data_len:
buf = proto.get_buffer(data_len)
Expand Down
2 changes: 1 addition & 1 deletion Lib/asyncio/sslproto.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ def data_received(self, data):
if chunk:
try:
if self._app_protocol_is_buffer:
protocols._feed_data_to_bufferred_proto(
protocols._feed_data_to_buffered_proto(
self._app_protocol, chunk)
else:
self._app_protocol.data_received(chunk)
Expand Down
12 changes: 6 additions & 6 deletions Lib/test/test_asyncio/test_sslproto.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,28 +190,28 @@ def buffer_updated(self, nsize):

for usemv in [False, True]:
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')

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')

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')

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')

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')

proto = Proto(0, usemv)
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):
HELLO_MSG = b'1' * self.PAYLOAD_SIZE
Expand Down

0 comments on commit ff6c077

Please sign in to comment.