Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc9930f5

Browse files
gh-123448: Move_PyNoDefault_Type to the static types array (#123449)
1 parentb379f1b commitc9930f5

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fixed memory leak of:class:`typing.NoDefault` by moving it to the static types
2+
array.

‎Modules/_typingmodule.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ _typing_exec(PyObject *m)
6363
if (PyModule_AddObjectRef(m,"TypeAliasType", (PyObject*)&_PyTypeAlias_Type)<0) {
6464
return-1;
6565
}
66-
if (PyType_Ready(&_PyNoDefault_Type)<0) {
67-
return-1;
68-
}
6966
if (PyModule_AddObjectRef(m,"NoDefault", (PyObject*)&_Py_NoDefaultStruct)<0) {
7067
return-1;
7168
}

‎Objects/object.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2347,6 +2347,7 @@ static PyTypeObject* static_types[] = {
23472347
&_PyWeakref_ProxyType,
23482348
&_PyWeakref_RefType,
23492349
&_PyTypeAlias_Type,
2350+
&_PyNoDefault_Type,
23502351

23512352
// subclasses: _PyTypes_FiniTypes() deallocates them before their base
23522353
// class

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp