Skip to content

Commit 5482db5

Browse files
[3.9] [codemod] Fix non-matching bracket pairs (GH-28473) (GH-28512)
Co-authored-by: Terry Jan Reedy <[email protected]> Co-authored-by: Serhiy Storchaka <[email protected]> Co-authored-by: Łukasz Langa <[email protected]>. (cherry picked from commit 8f943ca) Co-authored-by: Mohamad Mansour <[email protected]>
1 parent 09390c8 commit 5482db5

File tree

27 files changed

+43
-44
lines changed

27 files changed

+43
-44
lines changed

Doc/library/cgi.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ To get at submitted form data, use the :class:`FieldStorage` class. If the form
8989
contains non-ASCII characters, use the *encoding* keyword parameter set to the
9090
value of the encoding defined for the document. It is usually contained in the
9191
META tag in the HEAD section of the HTML document or by the
92-
:mailheader:`Content-Type` header). This reads the form contents from the
92+
:mailheader:`Content-Type` header. This reads the form contents from the
9393
standard input or the environment (depending on the value of various
9494
environment variables set according to the CGI standard). Since it may consume
9595
standard input, it should be instantiated only once.

Doc/library/logging.config.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ in :mod:`logging` itself) and defining handlers which are declared either in
163163
:func:`listen` socket and sending a configuration which runs whatever
164164
code the attacker wants to have executed in the victim's process. This is
165165
especially easy to do if the default port is used, but not hard even if a
166-
different port is used). To avoid the risk of this happening, use the
166+
different port is used. To avoid the risk of this happening, use the
167167
``verify`` argument to :func:`listen` to prevent unrecognised
168168
configurations from being applied.
169169

Doc/library/urllib.request.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ OpenerDirector Objects
650650
optional *timeout* parameter specifies a timeout in seconds for blocking
651651
operations like the connection attempt (if not specified, the global default
652652
timeout setting will be used). The timeout feature actually works only for
653-
HTTP, HTTPS and FTP connections).
653+
HTTP, HTTPS and FTP connections.
654654

655655

656656
.. method:: OpenerDirector.error(proto, *args)

Doc/reference/compound_stmts.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,6 @@ is semantically equivalent to::
479479
The specification, background, and examples for the Python :keyword:`with`
480480
statement.
481481

482-
483482
.. index::
484483
single: parameter; function definition
485484

Include/cpython/unicodeobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ enum PyUnicode_Kind {
416416

417417

418418
/* Fast check to determine whether an object is ready. Equivalent to
419-
PyUnicode_IS_COMPACT(op) || ((PyUnicodeObject*)(op))->data.any) */
419+
PyUnicode_IS_COMPACT(op) || ((PyUnicodeObject*)(op))->data.any */
420420

421421
#define PyUnicode_IS_READY(op) (((PyASCIIObject*)op)->state.ready)
422422

Lib/_osx_support.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ def customize_compiler(_config_vars):
482482
483483
This customization is performed when the first
484484
extension module build is requested
485-
in distutils.sysconfig.customize_compiler).
485+
in distutils.sysconfig.customize_compiler.
486486
"""
487487

488488
# Find a compiler to use for extension module builds

Lib/distutils/command/check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def check_metadata(self):
8383
name, version, URL
8484
8585
Recommended fields:
86-
(author and author_email) or (maintainer and maintainer_email))
86+
(author and author_email) or (maintainer and maintainer_email)
8787
8888
Warns if any are missing.
8989
"""

Lib/distutils/msvc9compiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ def manifest_get_embed_info(self, target_desc, ld_args):
673673
# If a manifest should be embedded, return a tuple of
674674
# (manifest_filename, resource_id). Returns None if no manifest
675675
# should be embedded. See http://bugs.python.org/issue7833 for why
676-
# we want to avoid any manifest for extension modules if we can)
676+
# we want to avoid any manifest for extension modules if we can.
677677
for arg in ld_args:
678678
if arg.startswith("/MANIFESTFILE:"):
679679
temp_manifest = arg.split(":", 1)[1]

Lib/graphlib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def __init__(self, node):
1717
self.npredecessors = 0
1818

1919
# List of successor nodes. The list can contain duplicated elements as
20-
# long as they're all reflected in the successor's npredecessors attribute).
20+
# long as they're all reflected in the successor's npredecessors attribute.
2121
self.successors = []
2222

2323

Lib/idlelib/idle_test/test_config_key.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
Coverage is effectively 100%. Tkinter dialog is mocked, Mac-only line
44
may be skipped, and dummy function in bind test should not be called.
5-
Not tested: exit with 'self.advanced or self.keys_ok(keys)) ...' False.
5+
Not tested: exit with 'self.advanced or self.keys_ok(keys) ...' False.
66
"""
77

88
from idlelib import config_key

Lib/idlelib/idle_test/test_query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Test query, coverage 93%).
1+
"""Test query, coverage 93%.
22
33
Non-gui tests for Query, SectionName, ModuleName, and HelpSource use
44
dummy versions that extract the non-gui methods and add other needed

Lib/msilib/schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@
664664
('Class','Component_','N',None, None, 'Component',1,'Identifier',None, 'Required foreign key into the Component Table, specifying the component for which to return a path when called through LocateComponent.',),
665665
('Class','Context','N',None, None, None, None, 'Identifier',None, 'The numeric server context for this server. CLSCTX_xxxx',),
666666
('Class','DefInprocHandler','Y',None, None, None, None, 'Filename','1;2;3','Optional default inproc handler. Only optionally provided if Context=CLSCTX_LOCAL_SERVER. Typically "ole32.dll" or "mapi32.dll"',),
667-
('Class','FileTypeMask','Y',None, None, None, None, 'Text',None, 'Optional string containing information for the HKCRthis CLSID) key. If multiple patterns exist, they must be delimited by a semicolon, and numeric subkeys will be generated: 0,1,2...',),
667+
('Class','FileTypeMask','Y',None, None, None, None, 'Text',None, 'Optional string containing information for the HKCRthis CLSID key. If multiple patterns exist, they must be delimited by a semicolon, and numeric subkeys will be generated: 0,1,2...',),
668668
('Class','Icon_','Y',None, None, 'Icon',1,'Identifier',None, 'Optional foreign key into the Icon Table, specifying the icon file associated with this CLSID. Will be written under the DefaultIcon key.',),
669669
('Class','IconIndex','Y',-32767,32767,None, None, None, None, 'Optional icon index.',),
670670
('Class','ProgId_Default','Y',None, None, 'ProgId',1,'Text',None, 'Optional ProgId associated with this CLSID.',),

Lib/pkgutil.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ def resolve_name(name):
673673
ValueError - if `name` isn't in a recognised format
674674
ImportError - if an import failed when it shouldn't have
675675
AttributeError - if a failure occurred when traversing the object hierarchy
676-
within the imported package to get to the desired object)
676+
within the imported package to get to the desired object.
677677
"""
678678
m = _NAME_PATTERN.match(name)
679679
if not m:

Lib/pydoc_data/topics.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Autogenerated by Sphinx on Mon Aug 30 20:40:44 2021
2+
# Autogenerated by Sphinx on Wed Sep 22 01:22:10 2021
33
topics = {'assert': 'The "assert" statement\n'
44
'**********************\n'
55
'\n'
@@ -3262,13 +3262,13 @@
32623262
'\n'
32633263
' If "__new__()" is invoked during object construction and '
32643264
'it returns\n'
3265-
' an instance or subclass of *cls*, then the new '
3266-
'instance’s\n'
3267-
' "__init__()" method will be invoked like '
3268-
'"__init__(self[, ...])",\n'
3269-
' where *self* is the new instance and the remaining '
3270-
'arguments are\n'
3271-
' the same as were passed to the object constructor.\n'
3265+
' an instance of *cls*, then the new instance’s '
3266+
'"__init__()" method\n'
3267+
' will be invoked like "__init__(self[, ...])", where '
3268+
'*self* is the\n'
3269+
' new instance and the remaining arguments are the same as '
3270+
'were\n'
3271+
' passed to the object constructor.\n'
32723272
'\n'
32733273
' If "__new__()" does not return an instance of *cls*, '
32743274
'then the new\n'
@@ -8120,13 +8120,13 @@
81208120
'\n'
81218121
' If "__new__()" is invoked during object construction and '
81228122
'it returns\n'
8123-
' an instance or subclass of *cls*, then the new '
8124-
'instance’s\n'
8125-
' "__init__()" method will be invoked like "__init__(self[, '
8126-
'...])",\n'
8127-
' where *self* is the new instance and the remaining '
8128-
'arguments are\n'
8129-
' the same as were passed to the object constructor.\n'
8123+
' an instance of *cls*, then the new instance’s '
8124+
'"__init__()" method\n'
8125+
' will be invoked like "__init__(self[, ...])", where '
8126+
'*self* is the\n'
8127+
' new instance and the remaining arguments are the same as '
8128+
'were\n'
8129+
' passed to the object constructor.\n'
81308130
'\n'
81318131
' If "__new__()" does not return an instance of *cls*, then '
81328132
'the new\n'

Lib/test/support/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -682,8 +682,8 @@ def dec(*args, **kwargs):
682682
# A constant likely larger than the underlying OS socket buffer size, to make
683683
# writes blocking.
684684
# The socket buffer sizes can usually be tuned system-wide (e.g. through sysctl
685-
# on Linux), or on a per-socket basis (SO_SNDBUF/SO_RCVBUF). See issue #18643
686-
# for a discussion of this number).
685+
# on Linux), or on a per-socket basis (SO_SNDBUF/SO_RCVBUF). See issue #18643
686+
# for a discussion of this number.
687687
SOCK_MAX_SIZE = 16 * 1024 * 1024 + 1
688688

689689
# decorator for skipping tests on non-IEEE 754 platforms

Lib/test/test_format.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ def test_common_format(self):
249249
# base marker shouldn't change the size
250250
testcommon("%0#35.33o", big, "0o012345670123456701234567012345670")
251251

252-
# Some small ints, in both Python int and flavors).
252+
# Some small ints, in both Python int and flavors.
253253
testcommon("%d", 42, "42")
254254
testcommon("%d", -42, "-42")
255255
testcommon("%d", 42.0, "42")

Lib/test/test_importlib/source/test_source_encoding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class EncodingTest:
2323
2424
PEP 263 specifies how that can change on a per-file basis. Either the first
2525
or second line can contain the encoding line [encoding first line]
26-
encoding second line]. If the file has the BOM marker it is considered UTF-8
26+
[encoding second line]. If the file has the BOM marker it is considered UTF-8
2727
implicitly [BOM]. If any encoding is specified it must be UTF-8, else it is
2828
an error [BOM and utf-8][BOM conflict].
2929

Lib/test/test_winreg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
("Raw Data", b"binary\x00data", REG_BINARY),
4646
("Big String", "x"*(2**14-1), REG_SZ),
4747
("Big Binary", b"x"*(2**14), REG_BINARY),
48-
# Two and three kanjis, meaning: "Japan" and "Japanese")
48+
# Two and three kanjis, meaning: "Japan" and "Japanese".
4949
("Japanese 日本", "日本語", REG_SZ),
5050
]
5151

Misc/NEWS.d/3.8.0b1.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ Make :func:`asyncio.create_subprocess_exec` accept path-like arguments.
568568
.. section: Library
569569
570570
Change default *max_workers* of ``ThreadPoolExecutor`` from ``cpu_count() *
571-
5`` to ``min(32, cpu_count() + 4))``. Previous value was unreasonably large
571+
5`` to ``min(32, cpu_count() + 4)``. Previous value was unreasonably large
572572
on many cores machines.
573573

574574
..

Modules/_datetimemodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,7 @@ new_time_ex(int hour, int minute, int second, int usecond,
10221022
* true. Passing false is a speed optimization, if you know for sure
10231023
* that seconds and microseconds are already in their proper ranges. In any
10241024
* case, raises OverflowError and returns NULL if the normalized days is out
1025-
* of range).
1025+
* of range.
10261026
*/
10271027
static PyObject *
10281028
new_delta_ex(int days, int seconds, int microseconds, int normalize,

Modules/_math.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ _Py_acosh(double x)
9090
* asinh(x) = sign(x) * log [ |x| + sqrt(x*x+1) ]
9191
* we have
9292
* asinh(x) := x if 1+x*x=1,
93-
* := sign(x)*(log(x)+ln2)) for large |x|, else
93+
* := sign(x)*(log(x)+ln2) for large |x|, else
9494
* := sign(x)*log(2|x|+1/(|x|+sqrt(x*x+1))) if|x|>2, else
9595
* := sign(x)*log1p(|x| + x^2/(1 + sqrt(1+x^2)))
9696
*/

Modules/arraymodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,12 +1636,12 @@ array.array.frombytes
16361636
buffer: Py_buffer
16371637
/
16381638
1639-
Appends items from the string, interpreting it as an array of machine values, as if it had been read from a file using the fromfile() method).
1639+
Appends items from the string, interpreting it as an array of machine values, as if it had been read from a file using the fromfile() method.
16401640
[clinic start generated code]*/
16411641

16421642
static PyObject *
16431643
array_array_frombytes_impl(arrayobject *self, Py_buffer *buffer)
1644-
/*[clinic end generated code: output=d9842c8f7510a516 input=2bbf2b53ebfcc988]*/
1644+
/*[clinic end generated code: output=d9842c8f7510a516 input=378db226dfac949e]*/
16451645
{
16461646
return frombytes(self, buffer);
16471647
}

Modules/clinic/arraymodule.c.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/zlibmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1361,7 +1361,7 @@ PyDoc_STRVAR(zlib_module_documentation,
13611361
"compressobj([level[, ...]]) -- Return a compressor object.\n"
13621362
"crc32(string[, start]) -- Compute a CRC-32 checksum.\n"
13631363
"decompress(string,[wbits],[bufsize]) -- Decompresses a compressed string.\n"
1364-
"decompressobj([wbits[, zdict]]]) -- Return a decompressor object.\n"
1364+
"decompressobj([wbits[, zdict]]) -- Return a decompressor object.\n"
13651365
"\n"
13661366
"'wbits' is window buffer size and container format.\n"
13671367
"Compressor objects support compress() and flush() methods; decompressor\n"

Objects/unicodeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10867,7 +10867,7 @@ replace(PyObject *self, PyObject *str1,
1086710867
release1 = 1;
1086810868
}
1086910869
/* new_size = PyUnicode_GET_LENGTH(self) + n * (PyUnicode_GET_LENGTH(str2) -
10870-
PyUnicode_GET_LENGTH(str1))); */
10870+
PyUnicode_GET_LENGTH(str1)); */
1087110871
if (len1 < len2 && len2 - len1 > (PY_SSIZE_T_MAX - slen) / n) {
1087210872
PyErr_SetString(PyExc_OverflowError,
1087310873
"replace string is too long");

PC/getpathp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
- If we DO have a Python Home: The relevant sub-directories (Lib,
3030
DLLs, etc) are based on the Python Home
3131
- If we DO NOT have a Python Home, the core Python Path is
32-
loaded from the registry. This is the main PythonPath key,
32+
loaded from the registry. (This is the main PythonPath key,
3333
and both HKLM and HKCU are combined to form the path)
3434
3535
* Iff - we can not locate the Python Home, have not had a PYTHONPATH

Tools/stringbench/stringbench.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ def join_alphabet_list_five(STR):
730730
for x in _RANGE_1000:
731731
sep_join(s2)
732732

733-
@bench('"A".join(["Bob"]*100))',
733+
@bench('"A".join(["Bob"]*100)',
734734
"join list of 100 words, with 1 character sep", 1000)
735735
def join_100_words_single(STR):
736736
sep = STR("A")

0 commit comments

Comments
 (0)