Skip to content

Commit 84f7382

Browse files
authored
bpo-42157: Rename unicodedata.ucnhash_CAPI (GH-22994)
Removed the unicodedata.ucnhash_CAPI attribute which was an internal PyCapsule object. The related private _PyUnicode_Name_CAPI structure was moved to the internal C API. Rename unicodedata.ucnhash_CAPI as unicodedata._ucnhash_CAPI.
1 parent c9bc290 commit 84f7382

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

Doc/whatsnew/3.10.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,11 @@ Removed
300300
Python 3.5.
301301
(Contributed by Berker Peksag in :issue:`31844`.)
302302

303+
* Removed the ``unicodedata.ucnhash_CAPI`` attribute which was an internal
304+
PyCapsule object. The related private ``_PyUnicode_Name_CAPI`` structure was
305+
moved to the internal C API.
306+
(Contributed by Victor Stinner in :issue:`42157`.)
307+
303308

304309
Porting to Python 3.10
305310
======================
@@ -408,7 +413,7 @@ Porting to Python 3.10
408413
(Contributed by Inada Naoki in :issue:`36346`.)
409414

410415
* The private ``_PyUnicode_Name_CAPI`` structure of the PyCapsule API
411-
``unicodedata.ucnhash_CAPI`` moves to the internal C API.
416+
``unicodedata.ucnhash_CAPI`` has been moved to the internal C API.
412417
(Contributed by Victor Stinner in :issue:`42157`.)
413418

414419
Deprecated

Include/internal/pycore_ucnhash.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ extern "C" {
1111

1212
/* revised ucnhash CAPI interface (exported through a "wrapper") */
1313

14-
#define PyUnicodeData_CAPSULE_NAME "unicodedata.ucnhash_CAPI"
14+
#define PyUnicodeData_CAPSULE_NAME "unicodedata._ucnhash_CAPI"
1515

1616
typedef struct {
1717

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
The private ``_PyUnicode_Name_CAPI`` structure of the PyCapsule API
2-
``unicodedata.ucnhash_CAPI`` moves to the internal C API.
2+
``unicodedata.ucnhash_CAPI`` has been moved to the internal C API.
33
Patch by Victor Stinner.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Removed the ``unicodedata.ucnhash_CAPI`` attribute which was an internal
2+
PyCapsule object. The related private ``_PyUnicode_Name_CAPI`` structure was
3+
moved to the internal C API. Patch by Victor Stinner.

Modules/unicodedata.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,7 +1463,7 @@ unicodedata_exec(PyObject *module)
14631463
return -1;
14641464
}
14651465

1466-
/* Previous versions */
1466+
// Unicode database version 3.2.0 used by the IDNA encoding
14671467
PyObject *v;
14681468
v = new_previous_version(ucd_type, "3.2.0",
14691469
get_change_3_2_0, normalization_3_2_0);
@@ -1482,7 +1482,7 @@ unicodedata_exec(PyObject *module)
14821482
if (v == NULL) {
14831483
return -1;
14841484
}
1485-
if (PyModule_AddObject(module, "ucnhash_CAPI", v) < 0) {
1485+
if (PyModule_AddObject(module, "_ucnhash_CAPI", v) < 0) {
14861486
Py_DECREF(v);
14871487
return -1;
14881488
}

0 commit comments

Comments
 (0)