Skip to content

Commit ccd82a0

Browse files
authored
[3.10] Fix typos in the Python directory (GH-28767) (GH-28799)
(cherry picked from commit db693df)
1 parent 212140d commit ccd82a0

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

Python/compile.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6157,7 +6157,7 @@ compiler_pattern_or(struct compiler *c, pattern_ty p, pattern_context *pc)
61576157
// cases, though.
61586158
assert(istores < icontrol);
61596159
Py_ssize_t rotations = istores + 1;
6160-
// Perfom the same rotation on pc->stores:
6160+
// Perform the same rotation on pc->stores:
61616161
PyObject *rotated = PyList_GetSlice(pc->stores, 0,
61626162
rotations);
61636163
if (rotated == NULL ||
@@ -6785,7 +6785,7 @@ consts_dict_keys_inorder(PyObject *dict)
67856785
return NULL;
67866786
while (PyDict_Next(dict, &pos, &k, &v)) {
67876787
i = PyLong_AS_LONG(v);
6788-
/* The keys of the dictionary can be tuples wrapping a contant.
6788+
/* The keys of the dictionary can be tuples wrapping a constant.
67896789
* (see compiler_add_o and _PyCode_ConstantKey). In that case
67906790
* the object we want is always second. */
67916791
if (PyTuple_CheckExact(k)) {

Python/fileutils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ check_force_ascii(void)
220220
ch = (unsigned char)0xA7;
221221
res = _Py_mbstowcs(&wch, (char*)&ch, 1);
222222
if (res != DECODE_ERROR && wch == L'\xA7') {
223-
/* On HP-UX withe C locale or the POSIX locale,
223+
/* On HP-UX with C locale or the POSIX locale,
224224
nl_langinfo(CODESET) announces "roman8", whereas mbstowcs() uses
225225
Latin1 encoding in practice. Force ASCII in this case.
226226

Python/import.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2195,7 +2195,7 @@ _PyImport_BootstrapImp(PyThreadState *tstate)
21952195
// Mock a ModuleSpec object just good enough for PyModule_FromDefAndSpec():
21962196
// an object with just a name attribute.
21972197
//
2198-
// _imp.__spec__ is overriden by importlib._bootstrap._instal() anyway.
2198+
// _imp.__spec__ is overridden by importlib._bootstrap._instal() anyway.
21992199
PyObject *attrs = Py_BuildValue("{sO}", "name", name);
22002200
if (attrs == NULL) {
22012201
goto error;

Python/initconfig.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2464,7 +2464,7 @@ warnoptions_append(PyConfig *config, PyWideStringList *options,
24642464
{
24652465
/* config_init_warnoptions() add existing config warnoptions at the end:
24662466
ensure that the new option is not already present in this list to
2467-
prevent change the options order whne config_init_warnoptions() is
2467+
prevent change the options order when config_init_warnoptions() is
24682468
called twice. */
24692469
if (_PyWideStringList_Find(&config->warnoptions, option)) {
24702470
/* Already present: do nothing */

Python/pathconfig.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ config_init_pathconfig(PyConfig *config, int compute_path_config)
405405
#undef COPY_ATTR
406406

407407
#ifdef MS_WINDOWS
408-
/* If a ._pth file is found: isolated and site_import are overriden */
408+
/* If a ._pth file is found: isolated and site_import are overridden */
409409
if (pathconfig.isolated != -1) {
410410
config->isolated = pathconfig.isolated;
411411
}

Python/pythonrun.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/* Top level execution of Python code (including in __main__) */
33

44
/* To help control the interfaces between the startup, execution and
5-
* shutdown code, the phases are split across separate modules (boostrap,
5+
* shutdown code, the phases are split across separate modules (bootstrap,
66
* pythonrun, shutdown)
77
*/
88

@@ -943,7 +943,7 @@ print_exception(PyObject *f, PyObject *value)
943943
if (end_lineno > lineno) {
944944
end_offset = (error_line != NULL) ? line_size : -1;
945945
}
946-
// Limit the ammount of '^' that we can display to
946+
// Limit the amount of '^' that we can display to
947947
// the size of the text in the source line.
948948
if (error_line != NULL && end_offset > line_size + 1) {
949949
end_offset = line_size + 1;

0 commit comments

Comments
 (0)