cpython: 9e4685d703d4 (original) (raw)
Mercurial > cpython
changeset 85228:9e4685d703d4 3.3
#18741: fix more typos. Patch by Févry Thibault. [#18741]
line wrap: on
line diff
--- a/Lib/concurrent/futures/process.py +++ b/Lib/concurrent/futures/process.py @@ -297,7 +297,7 @@ def _check_system_limits(): # sysconf not available or setting not available return if nsems_max == -1:
# indetermine limit, assume that limit is determined[](#l1.7)
if nsems_max >= 256: @@ -411,7 +411,7 @@ class ProcessPoolExecutor(_base.Executor self._result_queue.put(None) if wait: self._queue_management_thread.join()# indetermined limit, assume that limit is determined[](#l1.8) # by available memory only[](#l1.9) return[](#l1.10)
# To reduce the risk of openning too many files, remove references to[](#l1.16)
# To reduce the risk of opening too many files, remove references to[](#l1.17) # objects that use file descriptors.[](#l1.18) self._queue_management_thread = None[](#l1.19) self._call_queue = None[](#l1.20)
--- a/Lib/ctypes/test/runtests.py +++ b/Lib/ctypes/test/runtests.py @@ -2,7 +2,7 @@ Run all tests found in this directory, and print a summary of the results. Command line flags:
- -q quiet mode: don't print anything while the tests are running -r run tests repeatedly, look for refcount leaks -u Add resources to the lits of allowed resources. '*' allows all
--- a/Lib/ctypes/test/test_cfuncs.py +++ b/Lib/ctypes/test/test_cfuncs.py @@ -188,7 +188,7 @@ class CFunctions(unittest.TestCase): self.assertEqual(self._dll.tv_i(-42), None) self.assertEqual(self.S(), -42) -# The following repeates the above tests with stdcall functions (where +# The following repeats the above tests with stdcall functions (where
they are available)
--- a/Lib/ctypes/test/test_numbers.py +++ b/Lib/ctypes/test/test_numbers.py @@ -213,7 +213,7 @@ class NumberTestCase(unittest.TestCase): def test_init(self): # c_int() can be initialized from Python's int, and c_int.
# Not from c_long or so, which seems strange, abd should[](#l4.7)
# Not from c_long or so, which seems strange, abc should[](#l4.8) # probably be changed:[](#l4.9) self.assertRaises(TypeError, c_int, c_long(42))[](#l4.10)
--- a/Lib/ctypes/test/test_refcounts.py +++ b/Lib/ctypes/test/test_refcounts.py @@ -44,7 +44,7 @@ class RefcountTestCase(unittest.TestCase # this is the standard refcount for func self.assertEqual(grc(func), 2)
# the CFuncPtr instance holds atr least one refcount on func:[](#l5.7)
# the CFuncPtr instance holds at least one refcount on func:[](#l5.8) f = OtherCallback(func)[](#l5.9) self.assertTrue(grc(func) > 2)[](#l5.10)
@@ -61,7 +61,7 @@ class RefcountTestCase(unittest.TestCase x = X() x.a = OtherCallback(func)
# the CFuncPtr instance holds atr least one refcount on func:[](#l5.16)
# the CFuncPtr instance holds at least one refcount on func:[](#l5.17) self.assertTrue(grc(func) > 2)[](#l5.18)
# and may release it again @@ -74,7 +74,7 @@ class RefcountTestCase(unittest.TestCase f = OtherCallback(func)
# the CFuncPtr instance holds atr least one refcount on func:[](#l5.25)
# the CFuncPtr instance holds at least one refcount on func:[](#l5.26) self.assertTrue(grc(func) > 2)[](#l5.27)
--- a/Lib/ctypes/test/test_structures.py +++ b/Lib/ctypes/test/test_structures.py @@ -108,7 +108,7 @@ class StructureTestCase(unittest.TestCas def test_emtpy(self): # I had problems with these #
# Although these are patological cases: Empty Structures
# Although these are pathological cases: Empty Structures class X(Structure):[](#l6.9) _fields_ = [][](#l6.10)
--- a/Lib/distutils/command/install.py +++ b/Lib/distutils/command/install.py @@ -545,7 +545,7 @@ class install(Command): self.extra_dirs = extra_dirs def change_roots(self, *names):
"""Change the install direcories pointed by name using root."""[](#l7.7)
"""Change the install directories pointed by name using root."""[](#l7.8) for name in names:[](#l7.9) attr = "install_" + name[](#l7.10) setattr(self, attr, change_root(self.root, getattr(self, attr)))[](#l7.11)
--- a/Lib/distutils/command/sdist.py +++ b/Lib/distutils/command/sdist.py @@ -175,7 +175,7 @@ class sdist(Command): depends on the user's options. """ # new behavior when using a template:
# the file list is recalculated everytime because[](#l8.7)
# the file list is recalculated every time because[](#l8.8) # even if MANIFEST.in or setup.py are not changed[](#l8.9) # the user might have added some files in the tree that[](#l8.10) # need to be included.[](#l8.11)
--- a/Lib/distutils/tests/test_build_clib.py +++ b/Lib/distutils/tests/test_build_clib.py @@ -77,7 +77,7 @@ class BuildCLibTestCase(support.TempdirM cmd.compiler = FakeCompiler()
# build_libraries is also doing a bit of typoe checking[](#l9.7)
# build_libraries is also doing a bit of typo checking[](#l9.8) lib = [('name', {'sources': 'notvalid'})][](#l9.9) self.assertRaises(DistutilsSetupError, cmd.build_libraries, lib)[](#l9.10)
--- a/Lib/idlelib/idle_test/mock_tk.py +++ b/Lib/idlelib/idle_test/mock_tk.py @@ -35,7 +35,7 @@ class Mbox: """Mock for tkinter.messagebox with an Mbox_func for each function. This module was 'tkMessageBox' in 2.x; hence the 'import as' in 3.x.
- Example usage in test_module.py for testing functions in module.py: --- from idlelib.idle_test.mock_tk import Mbox import module @@ -98,7 +98,7 @@ class Text: This implements .index without converting the result back to a string. The result is contrained by the number of lines and linelengths of
self.data. For many indexes, the result is initally (1, 0).[](#l10.16)
self.data. For many indexes, the result is initially (1, 0).[](#l10.17)
The input index may have any of several possible forms: * line.char float: converted to 'line.char' string; @@ -149,7 +149,7 @@ class Text: -1: position before terminal \n; for .insert(), .delete 0: position after terminal \n; for .get, .delete index 1
1: same viewed as begininning of non-existent next line (for .index)[](#l10.25)
1: same viewed as beginning of non-existent next line (for .index)[](#l10.26) '''[](#l10.27) n = len(self.data)[](#l10.28) if endflag == 1:[](#l10.29)
@@ -271,7 +271,7 @@ class Text: "Scroll screen to make the character at INDEX is visible." pass
The following is a Misc method inherited by Text.
It should properly go in a Misc mock, but is included here for now.
def bind(sequence=None, func=None, add=None):
--- a/Lib/idlelib/idle_test/test_formatparagraph.py +++ b/Lib/idlelib/idle_test/test_formatparagraph.py @@ -244,7 +244,7 @@ class FormatEventTest(unittest.TestCase) """Test the formatting of text inside a Text widget. This is done with FormatParagraph.format.paragraph_event,
- which calls functions in the module as appropriate. """ test_string = ( " '''this is a test of a reformat for a triple "
--- a/Lib/lib2to3/fixes/fix_itertools.py +++ b/Lib/lib2to3/fixes/fix_itertools.py @@ -34,8 +34,8 @@ class FixItertools(fixer_base.BaseFix): # Remove the 'itertools' prefix = it.prefix it.remove()
# Replace the node wich contains ('.', 'function') with the[](#l12.7)
# function (to be consistant with the second part of the pattern)[](#l12.8)
# Replace the node which contains ('.', 'function') with the[](#l12.9)
# function (to be consistent with the second part of the pattern)[](#l12.10) dot.remove()[](#l12.11) func.parent.replace(func)[](#l12.12)
--- a/Lib/lib2to3/fixes/fix_metaclass.py +++ b/Lib/lib2to3/fixes/fix_metaclass.py @@ -71,7 +71,7 @@ def fixup_parse_tree(cls_node): def fixup_simple_stmt(parent, i, stmt_node): """ if there is a semi-colon all the parts count as part of the same simple_stmt. We just want the metaclass part so we move
everything efter the semi-colon into its own simple_stmt node[](#l13.7)
""" for semi_ind, node in enumerate(stmt_node.children): if node.type == token.SEMI: # sigheverything after the semi-colon into its own simple_stmt node[](#l13.8)
--- a/Lib/lib2to3/tests/test_parser.py +++ b/Lib/lib2to3/tests/test_parser.py @@ -77,7 +77,7 @@ class TestRaiseChanges(GrammarTest): self.invalid_syntax("raise E from") -# Adapated from Python 3's Lib/test/test_grammar.py:GrammarTests.testFuncdef +# Adaptated from Python 3's Lib/test/test_grammar.py:GrammarTests.testFuncdef class TestFunctionAnnotations(GrammarTest): def test_1(self): self.validate("""def f(x) -> list: pass""")
--- a/Lib/sqlite3/test/regression.py +++ b/Lib/sqlite3/test/regression.py @@ -161,7 +161,8 @@ class RegressionTests(unittest.TestCase) def CheckCursorConstructorCallCheck(self): """
Verifies that cursor methods check wether base class __init__ was called.[](#l15.7)
Verifies that cursor methods check whether base class __init__ was[](#l15.8)
called.[](#l15.9) """[](#l15.10) class Cursor(sqlite.Cursor):[](#l15.11) def __init__(self, con):[](#l15.12)
@@ -187,7 +188,8 @@ class RegressionTests(unittest.TestCase) def CheckConnectionConstructorCallCheck(self): """
Verifies that connection methods check wether base class __init__ was called.[](#l15.17)
Verifies that connection methods check whether base class __init__ was[](#l15.18)
called.[](#l15.19) """[](#l15.20) class Connection(sqlite.Connection):[](#l15.21) def __init__(self, name):[](#l15.22)
--- a/Lib/sqlite3/test/types.py +++ b/Lib/sqlite3/test/types.py @@ -229,7 +229,7 @@ class DeclTypesTests(unittest.TestCase): self.assertEqual(type(value), float) def CheckNumber2(self):
"""Checks wether converter names are cut off at '(' characters"""[](#l16.7)
"""Checks whether converter names are cut off at '(' characters"""[](#l16.8) self.cur.execute("insert into test(n2) values (5)")[](#l16.9) value = self.cur.execute("select n2 from test").fetchone()[0][](#l16.10) # if the converter is not used, it's an int instead of a float[](#l16.11)
--- a/Lib/test/support/init.py +++ b/Lib/test/support/init.py @@ -246,7 +246,7 @@ def unload(name): if sys.platform.startswith("win"): def _waitfor(func, pathname, waitall=False):
# Peform the operation[](#l17.7)
# Perform the operation[](#l17.8) func(pathname)[](#l17.9) # Now setup the wait loop[](#l17.10) if waitall:[](#l17.11)
@@ -262,7 +262,7 @@ if sys.platform.startswith("win"): # required when contention occurs. timeout = 0.001 while timeout < 1.0:
# Note we are only testing for the existance of the file(s) in[](#l17.16)
# Note we are only testing for the existence of the file(s) in[](#l17.17) # the contents of the directory regardless of any security or[](#l17.18) # access rights. If we have made it this far, we have sufficient[](#l17.19) # permissions to do that much using Python's equivalent of the[](#l17.20)
--- a/Lib/test/test_email/test_headerregistry.py +++ b/Lib/test/test_email/test_headerregistry.py @@ -531,7 +531,7 @@ class TestContentTypeHeader(TestHeaderBa '\tname1=%2A%2A%2Afun%2A%2A%2A%20;\tname*2="is it not.pdf"\n'), ),
# Make sure we also handle it if there are spurrious double qoutes.[](#l18.7)
# Make sure we also handle it if there are spurious double quotes.[](#l18.8) 'rfc2231_encoded_with_double_quotes': ([](#l18.9) ("text/plain;"[](#l18.10) '\tname*0*="us-ascii\'\'This%20is%20even%20more%20";'[](#l18.11)
@@ -711,8 +711,8 @@ class TestContentTypeHeader(TestHeaderBa # in double quotes, making the value a valid non-encoded string. The # old parser decodes this just like the previous case, which may be the # better Postel rule, but could equally result in borking headers that
# intentially have quoted quotes in them. We could get this 98% right[](#l18.16)
# if we treat it as a quoted string *unless* it matches the[](#l18.17)
# intentionally have quoted quotes in them. We could get this 98%[](#l18.18)
# right if we treat it as a quoted string *unless* it matches the[](#l18.19) # charset'lang'value pattern exactly *and* there is at least one[](#l18.20) # encoded segment. Implementing that algorithm will require some[](#l18.21) # refactoring, so I haven't done it (yet).[](#l18.22)
@@ -944,7 +944,7 @@ class TestMIMEVersionHeader(TestHeaderBa [errors.InvalidHeaderDefect]), # Unrecoverable invalid values. We could apply more heuristics to
# get someing out of the first two, but doing so is not worth the[](#l18.27)
# get something out of the first two, but doing so is not worth the[](#l18.28) # effort.[](#l18.29)
'non_comment_garbage_before': ( @@ -1541,13 +1541,13 @@ class TestFolding(TestHeaderBase): def test_fold_unstructured_with_commas(self): # The old wrapper would fold this at the commas. h = self.make_header('Subject', "This header is intended to "
"demonstrate, in a fairly susinct way, that we now do "[](#l18.36)
"demonstrate, in a fairly succinct way, that we now do "[](#l18.37) "not give a , special treatment in unstructured headers.")[](#l18.38) self.assertEqual([](#l18.39) h.fold(policy=policy.default.clone(max_line_length=60)),[](#l18.40) textwrap.dedent("""\[](#l18.41) Subject: This header is intended to demonstrate, in a fairly[](#l18.42)
susinct way, that we now do not give a , special treatment[](#l18.43)
succinct way, that we now do not give a , special treatment[](#l18.44) in unstructured headers.[](#l18.45) """))[](#l18.46)
--- a/Lib/unittest/test/test_case.py +++ b/Lib/unittest/test/test_case.py @@ -1054,7 +1054,7 @@ test case self.assertWarns(DeprecationWarning, _runtime_warn) def testAssertWarnsContext(self):
# Believe it or not, it is preferrable to duplicate all tests above,[](#l19.7)
# Believe it or not, it is preferable to duplicate all tests above,[](#l19.8) # to make sure the __warningregistry__ $@ is circumvented correctly.[](#l19.9) def _runtime_warn():[](#l19.10) warnings.warn("foo", RuntimeWarning)[](#l19.11)
--- a/Lib/unittest/test/test_loader.py
+++ b/Lib/unittest/test/test_loader.py
@@ -324,7 +324,7 @@ class Test_TestLoader(unittest.TestCase)
# Does loadTestsFromName raise TypeError when the module
argument
# isn't a module object?
#
XXX Accepts the not-a-module object, ignoring the object's type
# This should raise an exception or the method name should be changed
XXX Some people are relying on this, so keep it for now
--- a/Lib/unittest/test/test_program.py +++ b/Lib/unittest/test/test_program.py @@ -330,7 +330,7 @@ class TestCommandLineArgs(unittest.TestC self.assertEqual(program.testNames, argv[1:]) # it may be better to use platform specific functions to normalise paths
# rather than accepting '.PY' and '\' as file seprator on Linux / Mac[](#l21.7)
# rather than accepting '.PY' and '\' as file separator on Linux / Mac[](#l21.8) # it would also be better to check that a filename is a valid module[](#l21.9) # identifier (we have a regex for this in loader.py)[](#l21.10) # for invalid filenames should we raise a useful error rather than[](#l21.11)
--- a/Lib/xml/etree/ElementTree.py +++ b/Lib/xml/etree/ElementTree.py @@ -836,7 +836,7 @@ class ElementTree: @contextlib.contextmanager def _get_writer(file_or_filename, encoding):