Skip to content

Commit a72aec6

Browse files
authored
Merge branch 'main' into fix-issue-141141
2 parents 4796813 + bea0d3d commit a72aec6

File tree

5 files changed

+38
-5
lines changed

5 files changed

+38
-5
lines changed

Doc/c-api/codec.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,13 @@ Registry API for Unicode encoding error handlers
129129
Replace the unicode encode error with ``\N{...}`` escapes.
130130
131131
.. versionadded:: 3.5
132+
133+
134+
Codec utility variables
135+
-----------------------
136+
137+
.. c:var:: const char *Py_hexdigits
138+
139+
A string constant containing the lowercase hexadecimal digits: ``"0123456789abcdef"``.
140+
141+
.. versionadded:: 3.3

Doc/c-api/long.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,17 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
161161
.. versionadded:: 3.13
162162
163163
164+
.. c:macro:: PyLong_FromPid(pid)
165+
166+
Macro for creating a Python integer from a process identifier.
167+
168+
This can be defined as an alias to :c:func:`PyLong_FromLong` or
169+
:c:func:`PyLong_FromLongLong`, depending on the size of the system's
170+
PID type.
171+
172+
.. versionadded:: 3.2
173+
174+
164175
.. c:function:: long PyLong_AsLong(PyObject *obj)
165176
166177
.. index::
@@ -575,6 +586,17 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
575586
.. versionadded:: 3.13
576587
577588
589+
.. c:macro:: PyLong_AsPid(pid)
590+
591+
Macro for converting a Python integer into a process identifier.
592+
593+
This can be defined as an alias to :c:func:`PyLong_AsLong`,
594+
:c:func:`PyLong_FromLongLong`, or :c:func:`PyLong_AsInt`, depending on the
595+
size of the system's PID type.
596+
597+
.. versionadded:: 3.2
598+
599+
578600
.. c:function:: int PyLong_GetSign(PyObject *obj, int *sign)
579601
580602
Get the sign of the integer object *obj*.

Include/internal/pycore_moduleobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static inline PyModuleDef *_PyModule_GetDefOrNull(PyObject *arg) {
5353

5454
static inline PyModuleDef *_PyModule_GetToken(PyObject *arg) {
5555
PyModuleObject *mod = _PyModule_CAST(arg);
56-
return mod->md_token;
56+
return (PyModuleDef *)mod->md_token;
5757
}
5858

5959
static inline void* _PyModule_GetState(PyObject* mod) {

PC/winreg.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ PyDoc_STRVAR(module_doc,
5353
"DeleteKey() - Deletes the specified key.\n"
5454
"DeleteKeyEx() - Deletes the specified key.\n"
5555
"DeleteValue() - Removes a named value from the specified registry key.\n"
56+
"DeleteTree() - Deletes the specified key and all its subkeys and values recursively.\n"
5657
"EnumKey() - Enumerates subkeys of the specified open registry key.\n"
5758
"EnumValue() - Enumerates values of the specified open registry key.\n"
5859
"ExpandEnvironmentStrings() - Expand the env strings in a REG_EXPAND_SZ\n"
@@ -107,7 +108,9 @@ PyDoc_STRVAR(PyHKEY_doc,
107108
"Operations:\n"
108109
"__bool__ - Handles with an open object return true, otherwise false.\n"
109110
"__int__ - Converting a handle to an integer returns the Win32 handle.\n"
110-
"rich comparison - Handle objects are compared using the handle value.");
111+
"__enter__, __exit__ - Context manager support for 'with' statement,\n"
112+
"automatically closes handle.\n"
113+
"__eq__, __ne__ - Equality comparison based on Windows handle value.");
111114

112115

113116

Python/thread.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,14 +334,12 @@ PyThread_GetInfo(void)
334334

335335
#ifdef HAVE_PTHREAD_STUBS
336336
value = Py_NewRef(Py_None);
337-
#elif defined(_POSIX_THREADS)
337+
#else
338338
value = PyUnicode_FromString("pymutex");
339339
if (value == NULL) {
340340
Py_DECREF(threadinfo);
341341
return NULL;
342342
}
343-
#else
344-
value = Py_NewRef(Py_None);
345343
#endif
346344
PyStructSequence_SET_ITEM(threadinfo, pos++, value);
347345

0 commit comments

Comments
 (0)