asyncio: Fix spelling and typos.

Thanks to Vajrasky Kok for discovering some of them.
This commit is contained in:
Yury Selivanov 2014-02-18 22:27:48 -05:00
parent 74d519fcc6
commit dec1a45fd1
13 changed files with 18 additions and 19 deletions

View File

@ -235,7 +235,7 @@ class AbstractEventLoop:
sock=None, backlog=100, ssl=None): sock=None, backlog=100, ssl=None):
"""A coroutine which creates a UNIX Domain Socket server. """A coroutine which creates a UNIX Domain Socket server.
The return valud is a Server object, which can be used to stop The return value is a Server object, which can be used to stop
the service. the service.
path is a str, representing a file systsem path to bind the path is a str, representing a file systsem path to bind the

View File

@ -114,7 +114,7 @@ class SubprocessProtocol(BaseProtocol):
def pipe_data_received(self, fd, data): def pipe_data_received(self, fd, data):
"""Called when the subprocess writes data into stdout/stderr pipe. """Called when the subprocess writes data into stdout/stderr pipe.
fd is int file dascriptor. fd is int file descriptor.
data is bytes object. data is bytes object.
""" """

View File

@ -213,7 +213,7 @@ class BaseSelectorEventLoop(base_events.BaseEventLoop):
def _sock_recv(self, fut, registered, sock, n): def _sock_recv(self, fut, registered, sock, n):
# _sock_recv() can add itself as an I/O callback if the operation can't # _sock_recv() can add itself as an I/O callback if the operation can't
# be done immediatly. Don't use it directly, call sock_recv(). # be done immediately. Don't use it directly, call sock_recv().
fd = sock.fileno() fd = sock.fileno()
if registered: if registered:
# Remove the callback early. It should be rare that the # Remove the callback early. It should be rare that the

View File

@ -181,7 +181,7 @@ class Task(futures.Future):
The frames are always ordered from oldest to newest. The frames are always ordered from oldest to newest.
The optional limit gives the maximum nummber of frames to The optional limit gives the maximum number of frames to
return; by default all available frames are returned. Its return; by default all available frames are returned. Its
meaning differs depending on whether a stack or a traceback is meaning differs depending on whether a stack or a traceback is
returned: the newest frames of a stack are returned, but the returned: the newest frames of a stack are returned, but the

View File

@ -259,7 +259,7 @@ class TestLoop(base_events.BaseEventLoop):
when = yield ... when = yield ...
... = yield time_advance ... = yield time_advance
Value retuned by yield is absolute time of next scheduled handler. Value returned by yield is absolute time of next scheduled handler.
Value passed to yield is time advance to move loop's time forward. Value passed to yield is time advance to move loop's time forward.
""" """
@ -369,7 +369,7 @@ class MockPattern(str):
"""A regex based str with a fuzzy __eq__. """A regex based str with a fuzzy __eq__.
Use this helper with 'mock.assert_called_with', or anywhere Use this helper with 'mock.assert_called_with', or anywhere
where a regexp comparison between strings is needed. where a regex comparison between strings is needed.
For instance: For instance:
mock_call.assert_called_with(MockPattern('spam.*ham')) mock_call.assert_called_with(MockPattern('spam.*ham'))

View File

@ -80,7 +80,7 @@ class BaseSelector(metaclass=ABCMeta):
A selector can use various implementations (select(), poll(), epoll()...) A selector can use various implementations (select(), poll(), epoll()...)
depending on the platform. The default `Selector` class uses the most depending on the platform. The default `Selector` class uses the most
performant implementation on the current platform. efficient implementation on the current platform.
""" """
@abstractmethod @abstractmethod

View File

@ -277,7 +277,7 @@ class BaseEventLoopTests(unittest.TestCase):
asyncio.SubprocessProtocol, *args, bufsize=4096) asyncio.SubprocessProtocol, *args, bufsize=4096)
def test_subprocess_shell_invalid_args(self): def test_subprocess_shell_invalid_args(self):
# exepected a string, not an int or a list # expected a string, not an int or a list
self.assertRaises(TypeError, self.assertRaises(TypeError,
self.loop.run_until_complete, self.loop.subprocess_shell, self.loop.run_until_complete, self.loop.subprocess_shell,
asyncio.SubprocessProtocol, 123) asyncio.SubprocessProtocol, 123)

View File

@ -503,7 +503,6 @@ class EventLoopTestsMixin:
tr, pr = self.loop.run_until_complete(connection_fut) tr, pr = self.loop.run_until_complete(connection_fut)
self.assertIsInstance(tr, asyncio.Transport) self.assertIsInstance(tr, asyncio.Transport)
self.assertIsInstance(pr, asyncio.Protocol) self.assertIsInstance(pr, asyncio.Protocol)
self.assertIsNotNone(tr.get_extra_info('sockname'))
self.loop.run_until_complete(pr.done) self.loop.run_until_complete(pr.done)
self.assertGreater(pr.nbytes, 0) self.assertGreater(pr.nbytes, 0)
tr.close() tr.close()

View File

@ -38,7 +38,7 @@ class FutureTests(unittest.TestCase):
asyncio.set_event_loop(None) asyncio.set_event_loop(None)
def test_constructor_positional(self): def test_constructor_positional(self):
# Make sure Future does't accept a positional argument # Make sure Future doesn't accept a positional argument
self.assertRaises(TypeError, asyncio.Future, 42) self.assertRaises(TypeError, asyncio.Future, 42)
def test_cancel(self): def test_cancel(self):

View File

@ -239,7 +239,7 @@ class StreamReaderTests(unittest.TestCase):
# No b'\n' at the end. The 'limit' is set to 3. So before # No b'\n' at the end. The 'limit' is set to 3. So before
# waiting for the new data in buffer, 'readline' will consume # waiting for the new data in buffer, 'readline' will consume
# the entire buffer, and since the length of the consumed data # the entire buffer, and since the length of the consumed data
# is more than 3, it will raise a ValudError. The buffer is # is more than 3, it will raise a ValueError. The buffer is
# expected to be empty now. # expected to be empty now.
self.assertEqual(b'', stream._buffer) self.assertEqual(b'', stream._buffer)

View File

@ -965,7 +965,7 @@ class ChildWatcherTestsMixin:
self.assertFalse(m.WEXITSTATUS.called) self.assertFalse(m.WEXITSTATUS.called)
self.assertFalse(m.WTERMSIG.called) self.assertFalse(m.WTERMSIG.called)
# childen are running # children are running
self.watcher._sig_chld() self.watcher._sig_chld()
self.assertFalse(callback1.called) self.assertFalse(callback1.called)
@ -1069,7 +1069,7 @@ class ChildWatcherTestsMixin:
self.assertFalse(m.WEXITSTATUS.called) self.assertFalse(m.WEXITSTATUS.called)
self.assertFalse(m.WTERMSIG.called) self.assertFalse(m.WTERMSIG.called)
# childen are running # children are running
self.watcher._sig_chld() self.watcher._sig_chld()
self.assertFalse(callback1.called) self.assertFalse(callback1.called)
@ -1425,7 +1425,7 @@ class ChildWatcherTestsMixin:
self.add_zombie(61, 11) self.add_zombie(61, 11)
self.add_zombie(62, -5) self.add_zombie(62, -5)
# SIGCHLD was not catched # SIGCHLD was not caught
self.assertFalse(callback1.called) self.assertFalse(callback1.called)
self.assertFalse(callback2.called) self.assertFalse(callback2.called)
self.assertFalse(callback3.called) self.assertFalse(callback3.called)