Skip to content

Commit

Permalink
Use overridden
Browse files Browse the repository at this point in the history
  • Loading branch information
corona10 committed Oct 2, 2023
1 parent 551c76d commit 75021be
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Doc/library/os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5197,7 +5197,7 @@ Miscellaneous System Information

.. versionchanged:: 3.13
If :option:`-X cpu_count <-X>` is given or :envvar:`PYTHON_CPU_COUNT` is set,
:func:`cpu_count` returns the overrided value *n*.
:func:`cpu_count` returns the overridden value *n*.


.. function:: getloadavg()
Expand All @@ -5219,7 +5219,7 @@ Miscellaneous System Information
in the **system**.

If :option:`-X cpu_count <-X>` is given or :envvar:`PYTHON_CPU_COUNT` is set,
:func:`process_cpu_count` returns the overrided value *n*.
:func:`process_cpu_count` returns the overridden value *n*.

See also the :func:`sched_getaffinity` functions.

Expand Down
2 changes: 1 addition & 1 deletion Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ os
usable by the calling thread of the current process.
(Contributed by Victor Stinner in :gh:`109649`.)

* :func:`os.cpu_count` and :func:`os.process_cpu_count` can be overrided through
* :func:`os.cpu_count` and :func:`os.process_cpu_count` can be overridden through
the new environment variable :envvar:`PYTHON_CPU_COUNT` or the new command-line option
:option:`-X cpu_count <-X>`. This option is useful for users who need to limit
CPU resources of a container system without having to modify the container (application code).
Expand Down
2 changes: 1 addition & 1 deletion Lib/os.py
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,7 @@ def add_dll_directory(path):
)


if _exists('sched_getaffinity') and _get_cpu_count_config() != 'overrided':
if _exists('sched_getaffinity') and _get_cpu_count_config() != 'overridden':
def process_cpu_count():
"""
Get the number of CPUs of the current process.
Expand Down
2 changes: 1 addition & 1 deletion Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -14347,7 +14347,7 @@ os__get_cpu_count_config_impl(PyObject *module)
{
const PyConfig *config = _Py_GetConfig();
if (config->cpu_count > 0) {
return PyUnicode_FromString("overrided");
return PyUnicode_FromString("overridden");
}
return PyUnicode_FromString("default");
}
Expand Down

0 comments on commit 75021be

Please sign in to comment.