Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 80d62e6

Browse files
committed
Issue #23530: fix clinic comment.
1 parent aa525d0 commit 80d62e6

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

Modules/clinic/posixmodule.c.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2116,7 +2116,7 @@ PyDoc_STRVAR(os_sched_getaffinity__doc__,
21162116
"sched_getaffinity($module, pid, /)\n"
21172117
"--\n"
21182118
"\n"
2119-
"Return the affinity of the process identified by pid.\n"
2119+
"Return the affinity of the process identified by pid (or the current process if zero).\n"
21202120
"\n"
21212121
"The affinity is returned as a set of CPU identifiers.");
21222122

@@ -5178,7 +5178,11 @@ PyDoc_STRVAR(os_cpu_count__doc__,
51785178
"cpu_count($module, /)\n"
51795179
"--\n"
51805180
"\n"
5181-
"Return the number of CPUs in the system; return None if indeterminable.");
5181+
"Return the number of CPUs in the system; return None if indeterminable.\n"
5182+
"\n"
5183+
"This number is not equivalent to the number of CPUs the current process can\n"
5184+
"use. The number of usable CPUs can be obtained with\n"
5185+
"``len(os.sched_getaffinity(0))``");
51825186

51835187
#define OS_CPU_COUNT_METHODDEF \
51845188
{"cpu_count", (PyCFunction)os_cpu_count, METH_NOARGS, os_cpu_count__doc__},
@@ -5788,4 +5792,4 @@ os_set_handle_inheritable(PyModuleDef *module, PyObject *args)
57885792
#ifndef OS_SET_HANDLE_INHERITABLE_METHODDEF
57895793
#define OS_SET_HANDLE_INHERITABLE_METHODDEF
57905794
#endif /* !defined(OS_SET_HANDLE_INHERITABLE_METHODDEF) */
5791-
/*[clinic end generated code: output=f3f92b2d2e2c3fe3 input=a9049054013a1b77]*/
5795+
/*[clinic end generated code: output=35b50461dbecd65d input=a9049054013a1b77]*/

Modules/posixmodule.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5767,7 +5767,7 @@ The affinity is returned as a set of CPU identifiers.
57675767

57685768
static PyObject *
57695769
os_sched_getaffinity_impl(PyModuleDef *module, pid_t pid)
5770-
/*[clinic end generated code: output=b431a8f310e369e7 input=eaf161936874b8a1]*/
5770+
/*[clinic end generated code: output=b431a8f310e369e7 input=983ce7cb4a565980]*/
57715771
{
57725772
int cpu, ncpus, count;
57735773
size_t setsize;
@@ -11201,14 +11201,16 @@ get_terminal_size(PyObject *self, PyObject *args)
1120111201
/*[clinic input]
1120211202
os.cpu_count
1120311203
11204-
Return the number of CPUs in the system; return None if indeterminable. This
11205-
number is not equivalent to the number of CPUs the current process can use.
11206-
The number of usable CPUs can be obtained with ``len(os.sched_getaffinity(0))``
11204+
Return the number of CPUs in the system; return None if indeterminable.
11205+
11206+
This number is not equivalent to the number of CPUs the current process can
11207+
use. The number of usable CPUs can be obtained with
11208+
``len(os.sched_getaffinity(0))``
1120711209
[clinic start generated code]*/
1120811210

1120911211
static PyObject *
1121011212
os_cpu_count_impl(PyModuleDef *module)
11211-
/*[clinic end generated code: output=c59ee7f6bce832b8 input=d55e2f8f3823a628]*/
11213+
/*[clinic end generated code: output=c59ee7f6bce832b8 input=e7c8f4ba6dbbadd3]*/
1121211214
{
1121311215
int ncpu = 0;
1121411216
#ifdef MS_WINDOWS

0 commit comments

Comments
 (0)