Skip to content

Commit e0c6916

Browse files
committed
#18741: merge with 3.3.
2 parents 1d8e7db + b5bc353 commit e0c6916

File tree

22 files changed

+38
-36
lines changed

22 files changed

+38
-36
lines changed

Lib/concurrent/futures/process.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ def _check_system_limits():
301301
# sysconf not available or setting not available
302302
return
303303
if nsems_max == -1:
304-
# indetermine limit, assume that limit is determined
304+
# indetermined limit, assume that limit is determined
305305
# by available memory only
306306
return
307307
if nsems_max >= 256:
@@ -415,7 +415,7 @@ def shutdown(self, wait=True):
415415
self._result_queue.put(None)
416416
if wait:
417417
self._queue_management_thread.join()
418-
# To reduce the risk of openning too many files, remove references to
418+
# To reduce the risk of opening too many files, remove references to
419419
# objects that use file descriptors.
420420
self._queue_management_thread = None
421421
self._call_queue = None

Lib/ctypes/test/runtests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
Run all tests found in this directory, and print a summary of the results.
44
Command line flags:
5-
-q quiet mode: don't prnt anything while the tests are running
5+
-q quiet mode: don't print anything while the tests are running
66
-r run tests repeatedly, look for refcount leaks
77
-u<resources>
88
Add resources to the lits of allowed resources. '*' allows all

Lib/ctypes/test/test_cfuncs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def test_void(self):
188188
self.assertEqual(self._dll.tv_i(-42), None)
189189
self.assertEqual(self.S(), -42)
190190

191-
# The following repeates the above tests with stdcall functions (where
191+
# The following repeats the above tests with stdcall functions (where
192192
# they are available)
193193
try:
194194
WinDLL

Lib/ctypes/test/test_numbers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def test_char_from_address(self):
213213

214214
def test_init(self):
215215
# c_int() can be initialized from Python's int, and c_int.
216-
# Not from c_long or so, which seems strange, abd should
216+
# Not from c_long or so, which seems strange, abc should
217217
# probably be changed:
218218
self.assertRaises(TypeError, c_int, c_long(42))
219219

Lib/ctypes/test/test_refcounts.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def func(*args):
4444
# this is the standard refcount for func
4545
self.assertEqual(grc(func), 2)
4646

47-
# the CFuncPtr instance holds atr least one refcount on func:
47+
# the CFuncPtr instance holds at least one refcount on func:
4848
f = OtherCallback(func)
4949
self.assertTrue(grc(func) > 2)
5050

@@ -61,7 +61,7 @@ class X(ctypes.Structure):
6161
x = X()
6262
x.a = OtherCallback(func)
6363

64-
# the CFuncPtr instance holds atr least one refcount on func:
64+
# the CFuncPtr instance holds at least one refcount on func:
6565
self.assertTrue(grc(func) > 2)
6666

6767
# and may release it again
@@ -74,7 +74,7 @@ class X(ctypes.Structure):
7474

7575
f = OtherCallback(func)
7676

77-
# the CFuncPtr instance holds atr least one refcount on func:
77+
# the CFuncPtr instance holds at least one refcount on func:
7878
self.assertTrue(grc(func) > 2)
7979

8080
# create a cycle

Lib/ctypes/test/test_structures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class XX(Structure):
108108
def test_emtpy(self):
109109
# I had problems with these
110110
#
111-
# Although these are patological cases: Empty Structures!
111+
# Although these are pathological cases: Empty Structures!
112112
class X(Structure):
113113
_fields_ = []
114114

Lib/distutils/command/install.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ def handle_extra_path(self):
530530
self.extra_dirs = extra_dirs
531531

532532
def change_roots(self, *names):
533-
"""Change the install direcories pointed by name using root."""
533+
"""Change the install directories pointed by name using root."""
534534
for name in names:
535535
attr = "install_" + name
536536
setattr(self, attr, change_root(self.root, getattr(self, attr)))

Lib/distutils/command/sdist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def get_file_list(self):
175175
depends on the user's options.
176176
"""
177177
# new behavior when using a template:
178-
# the file list is recalculated everytime because
178+
# the file list is recalculated every time because
179179
# even if MANIFEST.in or setup.py are not changed
180180
# the user might have added some files in the tree that
181181
# need to be included.

Lib/distutils/tests/test_build_clib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def compile(*args, **kw):
7777

7878
cmd.compiler = FakeCompiler()
7979

80-
# build_libraries is also doing a bit of typoe checking
80+
# build_libraries is also doing a bit of typo checking
8181
lib = [('name', {'sources': 'notvalid'})]
8282
self.assertRaises(DistutilsSetupError, cmd.build_libraries, lib)
8383

Lib/idlelib/idle_test/mock_tk.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Mbox:
3535
"""Mock for tkinter.messagebox with an Mbox_func for each function.
3636
3737
This module was 'tkMessageBox' in 2.x; hence the 'import as' in 3.x.
38-
Example usage in test_module.py for testing functios in module.py:
38+
Example usage in test_module.py for testing functions in module.py:
3939
---
4040
from idlelib.idle_test.mock_tk import Mbox
4141
import module
@@ -98,7 +98,7 @@ def _decode(self, index, endflag=0):
9898
9999
This implements .index without converting the result back to a string.
100100
The result is contrained by the number of lines and linelengths of
101-
self.data. For many indexes, the result is initally (1, 0).
101+
self.data. For many indexes, the result is initially (1, 0).
102102
103103
The input index may have any of several possible forms:
104104
* line.char float: converted to 'line.char' string;
@@ -149,7 +149,7 @@ def _endex(self, endflag):
149149
150150
-1: position before terminal \n; for .insert(), .delete
151151
0: position after terminal \n; for .get, .delete index 1
152-
1: same viewed as begininning of non-existent next line (for .index)
152+
1: same viewed as beginning of non-existent next line (for .index)
153153
'''
154154
n = len(self.data)
155155
if endflag == 1:
@@ -271,7 +271,7 @@ def see(self, index):
271271
"Scroll screen to make the character at INDEX is visible."
272272
pass
273273

274-
# The following is a Misc method inheritet by Text.
274+
# The following is a Misc method inherited by Text.
275275
# It should properly go in a Misc mock, but is included here for now.
276276

277277
def bind(sequence=None, func=None, add=None):

Lib/idlelib/idle_test/test_formatparagraph.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ class FormatEventTest(unittest.TestCase):
244244
"""Test the formatting of text inside a Text widget.
245245
246246
This is done with FormatParagraph.format.paragraph_event,
247-
which calls funtions in the module as appropriate.
247+
which calls functions in the module as appropriate.
248248
"""
249249
test_string = (
250250
" '''this is a test of a reformat for a triple "

Lib/lib2to3/fixes/fix_itertools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ def transform(self, node, results):
3434
# Remove the 'itertools'
3535
prefix = it.prefix
3636
it.remove()
37-
# Replace the node wich contains ('.', 'function') with the
38-
# function (to be consistant with the second part of the pattern)
37+
# Replace the node which contains ('.', 'function') with the
38+
# function (to be consistent with the second part of the pattern)
3939
dot.remove()
4040
func.parent.replace(func)
4141

Lib/lib2to3/fixes/fix_metaclass.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def fixup_parse_tree(cls_node):
7171
def fixup_simple_stmt(parent, i, stmt_node):
7272
""" if there is a semi-colon all the parts count as part of the same
7373
simple_stmt. We just want the __metaclass__ part so we move
74-
everything efter the semi-colon into its own simple_stmt node
74+
everything after the semi-colon into its own simple_stmt node
7575
"""
7676
for semi_ind, node in enumerate(stmt_node.children):
7777
if node.type == token.SEMI: # *sigh*

Lib/lib2to3/tests/test_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def test_3x_style_invalid_4(self):
7777
self.invalid_syntax("raise E from")
7878

7979

80-
# Adapated from Python 3's Lib/test/test_grammar.py:GrammarTests.testFuncdef
80+
# Adaptated from Python 3's Lib/test/test_grammar.py:GrammarTests.testFuncdef
8181
class TestFunctionAnnotations(GrammarTest):
8282
def test_1(self):
8383
self.validate("""def f(x) -> list: pass""")

Lib/sqlite3/test/regression.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ def CheckSetIsolationLevel(self):
161161

162162
def CheckCursorConstructorCallCheck(self):
163163
"""
164-
Verifies that cursor methods check wether base class __init__ was called.
164+
Verifies that cursor methods check whether base class __init__ was
165+
called.
165166
"""
166167
class Cursor(sqlite.Cursor):
167168
def __init__(self, con):
@@ -187,7 +188,8 @@ class MyStr(str): pass
187188

188189
def CheckConnectionConstructorCallCheck(self):
189190
"""
190-
Verifies that connection methods check wether base class __init__ was called.
191+
Verifies that connection methods check whether base class __init__ was
192+
called.
191193
"""
192194
class Connection(sqlite.Connection):
193195
def __init__(self, name):

Lib/sqlite3/test/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def CheckNumber1(self):
229229
self.assertEqual(type(value), float)
230230

231231
def CheckNumber2(self):
232-
"""Checks wether converter names are cut off at '(' characters"""
232+
"""Checks whether converter names are cut off at '(' characters"""
233233
self.cur.execute("insert into test(n2) values (5)")
234234
value = self.cur.execute("select n2 from test").fetchone()[0]
235235
# if the converter is not used, it's an int instead of a float

Lib/test/support/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ def unload(name):
252252

253253
if sys.platform.startswith("win"):
254254
def _waitfor(func, pathname, waitall=False):
255-
# Peform the operation
255+
# Perform the operation
256256
func(pathname)
257257
# Now setup the wait loop
258258
if waitall:
@@ -268,7 +268,7 @@ def _waitfor(func, pathname, waitall=False):
268268
# required when contention occurs.
269269
timeout = 0.001
270270
while timeout < 1.0:
271-
# Note we are only testing for the existance of the file(s) in
271+
# Note we are only testing for the existence of the file(s) in
272272
# the contents of the directory regardless of any security or
273273
# access rights. If we have made it this far, we have sufficient
274274
# permissions to do that much using Python's equivalent of the

Lib/test/test_email/test_headerregistry.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ def content_type_as_value(self,
531531
'\tname*1*=%2A%2A%2Afun%2A%2A%2A%20;\tname*2="is it not.pdf"\n'),
532532
),
533533

534-
# Make sure we also handle it if there are spurrious double qoutes.
534+
# Make sure we also handle it if there are spurious double quotes.
535535
'rfc2231_encoded_with_double_quotes': (
536536
("text/plain;"
537537
'\tname*0*="us-ascii\'\'This%20is%20even%20more%20";'
@@ -711,8 +711,8 @@ def content_type_as_value(self,
711711
# in double quotes, making the value a valid non-encoded string. The
712712
# old parser decodes this just like the previous case, which may be the
713713
# better Postel rule, but could equally result in borking headers that
714-
# intentially have quoted quotes in them. We could get this 98% right
715-
# if we treat it as a quoted string *unless* it matches the
714+
# intentionally have quoted quotes in them. We could get this 98%
715+
# right if we treat it as a quoted string *unless* it matches the
716716
# charset'lang'value pattern exactly *and* there is at least one
717717
# encoded segment. Implementing that algorithm will require some
718718
# refactoring, so I haven't done it (yet).
@@ -944,7 +944,7 @@ def version_string_as_MIME_Version(self,
944944
[errors.InvalidHeaderDefect]),
945945

946946
# Unrecoverable invalid values. We *could* apply more heuristics to
947-
# get someing out of the first two, but doing so is not worth the
947+
# get something out of the first two, but doing so is not worth the
948948
# effort.
949949

950950
'non_comment_garbage_before': (
@@ -1541,13 +1541,13 @@ def test_fold_unstructured_with_slightly_long_word(self):
15411541
def test_fold_unstructured_with_commas(self):
15421542
# The old wrapper would fold this at the commas.
15431543
h = self.make_header('Subject', "This header is intended to "
1544-
"demonstrate, in a fairly susinct way, that we now do "
1544+
"demonstrate, in a fairly succinct way, that we now do "
15451545
"not give a , special treatment in unstructured headers.")
15461546
self.assertEqual(
15471547
h.fold(policy=policy.default.clone(max_line_length=60)),
15481548
textwrap.dedent("""\
15491549
Subject: This header is intended to demonstrate, in a fairly
1550-
susinct way, that we now do not give a , special treatment
1550+
succinct way, that we now do not give a , special treatment
15511551
in unstructured headers.
15521552
"""))
15531553

Lib/unittest/test/test_case.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1146,7 +1146,7 @@ def _runtime_warn():
11461146
self.assertWarns(DeprecationWarning, _runtime_warn)
11471147

11481148
def testAssertWarnsContext(self):
1149-
# Believe it or not, it is preferrable to duplicate all tests above,
1149+
# Believe it or not, it is preferable to duplicate all tests above,
11501150
# to make sure the __warningregistry__ $@ is circumvented correctly.
11511151
def _runtime_warn():
11521152
warnings.warn("foo", RuntimeWarning)

Lib/unittest/test/test_loader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ def test_loadTestsFromName__relative_malformed_name(self):
324324
# Does loadTestsFromName raise TypeError when the `module` argument
325325
# isn't a module object?
326326
#
327-
# XXX Accepts the not-a-module object, ignorning the object's type
327+
# XXX Accepts the not-a-module object, ignoring the object's type
328328
# This should raise an exception or the method name should be changed
329329
#
330330
# XXX Some people are relying on this, so keep it for now

Lib/unittest/test/test_program.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ def testParseArgsAbsolutePathsThatCannotBeConverted(self):
365365
self.assertEqual(program.testNames, argv[1:])
366366

367367
# it may be better to use platform specific functions to normalise paths
368-
# rather than accepting '.PY' and '\' as file seprator on Linux / Mac
368+
# rather than accepting '.PY' and '\' as file separator on Linux / Mac
369369
# it would also be better to check that a filename is a valid module
370370
# identifier (we have a regex for this in loader.py)
371371
# for invalid filenames should we raise a useful error rather than

Lib/xml/etree/ElementTree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ def write_c14n(self, file):
786786

787787
@contextlib.contextmanager
788788
def _get_writer(file_or_filename, encoding):
789-
# returns text write method and release all resourses after using
789+
# returns text write method and release all resources after using
790790
try:
791791
write = file_or_filename.write
792792
except AttributeError:

0 commit comments

Comments
 (0)