[3.10] Fix typos in the Python directory (GH-28767) (GH-28799)

(cherry picked from commit db693df3e1)
This commit is contained in:
Christian Clauss 2021-10-07 17:30:08 +02:00 committed by GitHub
parent 212140dceb
commit ccd82a0800
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 8 deletions

View file

@ -6157,7 +6157,7 @@ compiler_pattern_or(struct compiler *c, pattern_ty p, pattern_context *pc)
// cases, though. // cases, though.
assert(istores < icontrol); assert(istores < icontrol);
Py_ssize_t rotations = istores + 1; Py_ssize_t rotations = istores + 1;
// Perfom the same rotation on pc->stores: // Perform the same rotation on pc->stores:
PyObject *rotated = PyList_GetSlice(pc->stores, 0, PyObject *rotated = PyList_GetSlice(pc->stores, 0,
rotations); rotations);
if (rotated == NULL || if (rotated == NULL ||
@ -6785,7 +6785,7 @@ consts_dict_keys_inorder(PyObject *dict)
return NULL; return NULL;
while (PyDict_Next(dict, &pos, &k, &v)) { while (PyDict_Next(dict, &pos, &k, &v)) {
i = PyLong_AS_LONG(v); i = PyLong_AS_LONG(v);
/* The keys of the dictionary can be tuples wrapping a contant. /* The keys of the dictionary can be tuples wrapping a constant.
* (see compiler_add_o and _PyCode_ConstantKey). In that case * (see compiler_add_o and _PyCode_ConstantKey). In that case
* the object we want is always second. */ * the object we want is always second. */
if (PyTuple_CheckExact(k)) { if (PyTuple_CheckExact(k)) {

View file

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

View file

@ -2195,7 +2195,7 @@ _PyImport_BootstrapImp(PyThreadState *tstate)
// Mock a ModuleSpec object just good enough for PyModule_FromDefAndSpec(): // Mock a ModuleSpec object just good enough for PyModule_FromDefAndSpec():
// an object with just a name attribute. // an object with just a name attribute.
// //
// _imp.__spec__ is overriden by importlib._bootstrap._instal() anyway. // _imp.__spec__ is overridden by importlib._bootstrap._instal() anyway.
PyObject *attrs = Py_BuildValue("{sO}", "name", name); PyObject *attrs = Py_BuildValue("{sO}", "name", name);
if (attrs == NULL) { if (attrs == NULL) {
goto error; goto error;

View file

@ -2464,7 +2464,7 @@ warnoptions_append(PyConfig *config, PyWideStringList *options,
{ {
/* config_init_warnoptions() add existing config warnoptions at the end: /* config_init_warnoptions() add existing config warnoptions at the end:
ensure that the new option is not already present in this list to ensure that the new option is not already present in this list to
prevent change the options order whne config_init_warnoptions() is prevent change the options order when config_init_warnoptions() is
called twice. */ called twice. */
if (_PyWideStringList_Find(&config->warnoptions, option)) { if (_PyWideStringList_Find(&config->warnoptions, option)) {
/* Already present: do nothing */ /* Already present: do nothing */

View file

@ -405,7 +405,7 @@ config_init_pathconfig(PyConfig *config, int compute_path_config)
#undef COPY_ATTR #undef COPY_ATTR
#ifdef MS_WINDOWS #ifdef MS_WINDOWS
/* If a ._pth file is found: isolated and site_import are overriden */ /* If a ._pth file is found: isolated and site_import are overridden */
if (pathconfig.isolated != -1) { if (pathconfig.isolated != -1) {
config->isolated = pathconfig.isolated; config->isolated = pathconfig.isolated;
} }

View file

@ -2,7 +2,7 @@
/* Top level execution of Python code (including in __main__) */ /* Top level execution of Python code (including in __main__) */
/* To help control the interfaces between the startup, execution and /* To help control the interfaces between the startup, execution and
* shutdown code, the phases are split across separate modules (boostrap, * shutdown code, the phases are split across separate modules (bootstrap,
* pythonrun, shutdown) * pythonrun, shutdown)
*/ */
@ -943,7 +943,7 @@ print_exception(PyObject *f, PyObject *value)
if (end_lineno > lineno) { if (end_lineno > lineno) {
end_offset = (error_line != NULL) ? line_size : -1; end_offset = (error_line != NULL) ? line_size : -1;
} }
// Limit the ammount of '^' that we can display to // Limit the amount of '^' that we can display to
// the size of the text in the source line. // the size of the text in the source line.
if (error_line != NULL && end_offset > line_size + 1) { if (error_line != NULL && end_offset > line_size + 1) {
end_offset = line_size + 1; end_offset = line_size + 1;