Skip to content

Commit db693df

Browse files
authored
Fix typos in the Python directory (GH-28767)
1 parent 6c942a8 commit db693df

7 files changed

+11
-11
lines changed

Python/compile.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -6335,7 +6335,7 @@ compiler_pattern_or(struct compiler *c, pattern_ty p, pattern_context *pc)
63356335
// cases, though.
63366336
assert(istores < icontrol);
63376337
Py_ssize_t rotations = istores + 1;
6338-
// Perfom the same rotation on pc->stores:
6338+
// Perform the same rotation on pc->stores:
63396339
PyObject *rotated = PyList_GetSlice(pc->stores, 0,
63406340
rotations);
63416341
if (rotated == NULL ||
@@ -7326,7 +7326,7 @@ consts_dict_keys_inorder(PyObject *dict)
73267326
return NULL;
73277327
while (PyDict_Next(dict, &pos, &k, &v)) {
73287328
i = PyLong_AS_LONG(v);
7329-
/* The keys of the dictionary can be tuples wrapping a contant.
7329+
/* The keys of the dictionary can be tuples wrapping a constant.
73307330
* (see compiler_add_o and _PyCode_ConstantKey). In that case
73317331
* the object we want is always second. */
73327332
if (PyTuple_CheckExact(k)) {

Python/fileutils.c

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

Python/import.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2458,7 +2458,7 @@ _PyImport_BootstrapImp(PyThreadState *tstate)
24582458
// Mock a ModuleSpec object just good enough for PyModule_FromDefAndSpec():
24592459
// an object with just a name attribute.
24602460
//
2461-
// _imp.__spec__ is overriden by importlib._bootstrap._instal() anyway.
2461+
// _imp.__spec__ is overridden by importlib._bootstrap._instal() anyway.
24622462
PyObject *attrs = Py_BuildValue("{sO}", "name", name);
24632463
if (attrs == NULL) {
24642464
goto error;

Python/initconfig.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static const char usage_3[] = "\
9898
-X no_debug_ranges: disable the inclusion of the tables mapping extra location \n\
9999
information (end line, start column offset and end column offset) to every \n\
100100
instruction in code objects. This is useful when smaller code objects and pyc \n\
101-
files are desired as well as supressing the extra visual location indicators \n\
101+
files are desired as well as suppressing the extra visual location indicators \n\
102102
when the interpreter displays tracebacks.\n\
103103
-X frozen_modules=[on|off]: whether or not frozen modules should be used.\n\
104104
The default is \"on\" (or \"off\" if you are running a local build).\n\
@@ -142,7 +142,7 @@ static const char usage_6[] =
142142
"PYTHONNODEBUGRANGES: If this variable is set, it disables the inclusion of the \n"
143143
" tables mapping extra location information (end line, start column offset \n"
144144
" and end column offset) to every instruction in code objects. This is useful \n"
145-
" when smaller cothe de objects and pyc files are desired as well as supressing the \n"
145+
" when smaller cothe de objects and pyc files are desired as well as suppressing the \n"
146146
" extra visual location indicators when the interpreter displays tracebacks.\n";
147147

148148
#if defined(MS_WINDOWS)
@@ -2549,7 +2549,7 @@ warnoptions_append(PyConfig *config, PyWideStringList *options,
25492549
{
25502550
/* config_init_warnoptions() add existing config warnoptions at the end:
25512551
ensure that the new option is not already present in this list to
2552-
prevent change the options order whne config_init_warnoptions() is
2552+
prevent change the options order when config_init_warnoptions() is
25532553
called twice. */
25542554
if (_PyWideStringList_Find(&config->warnoptions, option)) {
25552555
/* Already present: do nothing */

Python/pathconfig.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ config_init_pathconfig(PyConfig *config, int compute_path_config)
411411
#undef COPY_ATTR
412412

413413
#ifdef MS_WINDOWS
414-
/* If a ._pth file is found: isolated and site_import are overriden */
414+
/* If a ._pth file is found: isolated and site_import are overridden */
415415
if (pathconfig.isolated != -1) {
416416
config->isolated = pathconfig.isolated;
417417
}

Python/pythonrun.c

+2-2
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;

Python/specialize.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ specialize_dict_access(
588588
{
589589
assert(kind == NON_OVERRIDING || kind == NON_DESCRIPTOR || kind == ABSENT ||
590590
kind == BUILTIN_CLASSMETHOD || kind == PYTHON_CLASSMETHOD);
591-
// No desciptor, or non overriding.
591+
// No descriptor, or non overriding.
592592
if (type->tp_dictoffset < 0) {
593593
SPECIALIZATION_FAIL(base_op, SPEC_FAIL_OUT_OF_RANGE);
594594
return 0;

0 commit comments

Comments
 (0)