]>
git.ipfire.org Git - thirdparty/Python/cpython.git/log
Miro Hrončok [Wed, 3 Aug 2022 23:19:36 +0000 (01:19 +0200)]
gh-94675: Add a regression test for rjsmin re slowdown (GH-94685)
Adds a regression test for an re slowdown observed by rjsmin.
Uses multiprocessing to kill the test after SHORT_TIMEOUT.
Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
Co-authored-by: Christian Heimes <christian@python.org>
Hugo van Kemenade [Wed, 3 Aug 2022 21:47:20 +0000 (00:47 +0300)]
gh-90817: Use .. deprecated-removed:: when removal version known (#94960)
Steve Dower [Wed, 3 Aug 2022 21:18:51 +0000 (22:18 +0100)]
gh-94399: Restore PATH search behaviour of py.exe launcher for '/usr/bin/env' shebang lines (GH-95582)
Jo, Yunjin [Wed, 3 Aug 2022 21:16:15 +0000 (06:16 +0900)]
gh-95597: Fix typo in Lib directory files (#95599)
Ethan Furman [Wed, 3 Aug 2022 21:11:20 +0000 (14:11 -0700)]
[Enum] add whatsnew entries (GH-95455)
Derek Kim [Wed, 3 Aug 2022 20:55:03 +0000 (15:55 -0500)]
gh-95423: Update winreg.DeleteKeyEx documentation and remove dynamic function load (GH-95521)
Erlend Egeberg Aasland [Wed, 3 Aug 2022 20:21:15 +0000 (22:21 +0200)]
gh-95273: Align sqlite3 const doc refs with the devguide recommendations (#95525)
Stéphane Bidoul [Wed, 3 Aug 2022 19:26:51 +0000 (21:26 +0200)]
gh-95609: update bundled pip to 22.2.2 (gh-95610)
CAM Gerlach [Wed, 3 Aug 2022 19:23:20 +0000 (14:23 -0500)]
gh-91207: Fix CSS bug in Windows CHM help file and add deprecation message (GH-95607)
Mark Shannon [Wed, 3 Aug 2022 17:56:24 +0000 (18:56 +0100)]
GH-92678: Fix tp_dictoffset inheritance. (GH-95596)
* Add test for inheriting explicit __dict__ and weakref.
* Restore 3.10 behavior for multiple inheritance of C extension classes that store their dictionary at the end of the struct.
Erlend Egeberg Aasland [Tue, 2 Aug 2022 22:17:09 +0000 (00:17 +0200)]
Docs: fix incorrect formatting in sqlite3 CLI docs (#95581)
Christian Heimes [Tue, 2 Aug 2022 19:00:41 +0000 (21:00 +0200)]
gh-95451: Update docs for wasm32-emscripten and -wasi platforms (GH-95452)
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Michael Droettboom <mdboom@gmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
CAM Gerlach [Tue, 2 Aug 2022 07:42:35 +0000 (02:42 -0500)]
gh-95516: Add param types and clarify param descriptions of LogRecord (GH-95517)
Erlend Egeberg Aasland [Tue, 2 Aug 2022 04:23:42 +0000 (06:23 +0200)]
gh-83270: Update IDLE's credits (#95528)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Terry Jan Reedy [Tue, 2 Aug 2022 04:10:39 +0000 (00:10 -0400)]
gh-95191: IDLE: Include prompts when saving Shell #95554
Steve Dower [Mon, 1 Aug 2022 23:57:46 +0000 (00:57 +0100)]
gh-92219: Clarify that some options to the installer may break the install (GH-95548)
Eric Snow [Mon, 1 Aug 2022 23:13:23 +0000 (17:13 -0600)]
gh-90110: Get the C Analyzer Tool Working Again (gh-95545)
Brandt Bucher [Mon, 1 Aug 2022 18:02:56 +0000 (11:02 -0700)]
GH-95150: Use position and exception tables for code hashing and equality (GH-95509)
Eugene Triguba [Mon, 1 Aug 2022 16:52:39 +0000 (11:52 -0500)]
gh-91447: Fix findtext to only give an empty string on None (GH-91486)
The API documentation for [findtext](https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.ElementTree.Element.findtext) states that this function gives back an empty string on "no text content." With the previous implementation, this would give back a empty string even on text content values such as 0 or False. This patch attempts to resolve that by only giving back an empty string if the text attribute is set to `None`. Resolves #91447.
Automerge-Triggered-By: GH:gvanrossum
Oleg Iarygin [Mon, 1 Aug 2022 16:30:15 +0000 (19:30 +0300)]
gh-95417: Quick fix for "ULONG_PTR differs in levels of indirection from void *" (GH-95538)
Jacob Walls [Mon, 1 Aug 2022 16:02:09 +0000 (12:02 -0400)]
gh-95173: Add a regression test for sorting tuples containing None (#95464)
neonene [Mon, 1 Aug 2022 15:37:32 +0000 (00:37 +0900)]
gh-95445: Ensure Windows msi uninstalls document folder successfully (GH-95465)
Alex Hedges [Mon, 1 Aug 2022 15:06:43 +0000 (11:06 -0400)]
no-issue: Fix typo of "thrid" instead of "third" in dis docs (gh-95510)
Mark Shannon [Mon, 1 Aug 2022 13:34:54 +0000 (14:34 +0100)]
GH-95245: Store object values and dict pointers in single tagged pointer. (GH-95278)
Dong-hee Na [Mon, 1 Aug 2022 13:15:07 +0000 (22:15 +0900)]
gh-91146: More reduce allocation size of list from str.split/rsplit (gh-95493)
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
Noam Cohen [Mon, 1 Aug 2022 13:07:35 +0000 (16:07 +0300)]
gh-95007: Remove the NoneType return converter from Argument Clinic Doc (#95529)
The converter was removed in
74b5e4ce80858ac5c7d03411cb8cce7e6865f181
Petr Viktorin [Mon, 1 Aug 2022 13:04:14 +0000 (15:04 +0200)]
gh-93649: Split heaptype tests from _testcapimodule.c (GH-95386)
This removes the unused negative_dictoffset function:
the type this function would create is available as
_testcapi.HeapCTypeWithNegativeDict
Erlend Egeberg Aasland [Mon, 1 Aug 2022 10:25:16 +0000 (12:25 +0200)]
gh-77617: Add sqlite3 command-line interface (#95026)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Erlend Egeberg Aasland [Mon, 1 Aug 2022 09:15:07 +0000 (11:15 +0200)]
gh-95273: Clarify when sqlite_* attributes are added to sqlite3 exceptions (#95523)
Terry Jan Reedy [Mon, 1 Aug 2022 05:06:13 +0000 (01:06 -0400)]
gh-95511: IDLE - fix Shell context menu copy-with-prompts bug (#95512)
If one selects whole lines, as the sidebar makes easy, do not
add an extra line. Only move the end of a selection to the
beginning of the next line when not already at the beginning
of a line. (Also improve the surrounding code.)
markus-sus [Mon, 1 Aug 2022 02:42:13 +0000 (04:42 +0200)]
bpo-42037: Corrected request dependencies in CookieJar functions (GH-23112)
Serhiy Storchaka [Sun, 31 Jul 2022 20:47:28 +0000 (23:47 +0300)]
IDLE: Fix docs URL in the About window (#28417)
Pablo Galindo Salgado [Sun, 31 Jul 2022 15:33:56 +0000 (16:33 +0100)]
bpo-45445: Revert "bpo-45445: Fail if an invalid X-option is provided in the command line (GH-28823)" (#94745)
Dong-hee Na [Sun, 31 Jul 2022 03:14:53 +0000 (12:14 +0900)]
gh-91146: Reduce allocation size of list from str.split()/rsplit() (gh-95473)
Terry Jan Reedy [Sun, 31 Jul 2022 01:09:07 +0000 (21:09 -0400)]
gh-95471: IDLE - Tweak Edit menu (#95481)
Move `Select All` above `Cut` as it is used with `Cut` and `Copy` but not `Paste`. Add a separator between `Replace` and `Go to Line` to separate items that belong to the 'Edit-find' (above) and 'Edit-show' (below) IDLE github project topics.
Erlend Egeberg Aasland [Sat, 30 Jul 2022 23:24:15 +0000 (01:24 +0200)]
gh-94635: Add Reference, How-to, and Concepts headings to sqlite3 docs (#94636)
Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
Zachary Ware [Sat, 30 Jul 2022 22:21:08 +0000 (17:21 -0500)]
Doctest cleanups (GH-95436)
* GHA: Don't hide doctest output
* Enable doctests in math.rst
* Squash warnings in nntplib.rst doctests
* Squash warning in turtle.rst doctest
* Squash warnings in whatsnew/3.2.rst doctests
* Treat warnings as errors in Doc/ doctests
Terry Jan Reedy [Sat, 30 Jul 2022 19:57:37 +0000 (15:57 -0400)]
gh-90654: IDLE - Insert blank line in NEWS.txt (#95478)
Needed for backports.
Robert O'Shea [Sat, 30 Jul 2022 07:42:21 +0000 (08:42 +0100)]
gh-95454: Replace truthy/falsy with true/false (GH-95456)
Serhiy Storchaka [Sat, 30 Jul 2022 06:16:22 +0000 (09:16 +0300)]
gh-94938: Fix test (GH-95396)
Erlend Egeberg Aasland [Sat, 30 Jul 2022 04:42:13 +0000 (06:42 +0200)]
gh-95411: IDLE - Enable using the module browser with .pyw files (#95397)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Erlend Egeberg Aasland [Fri, 29 Jul 2022 19:27:15 +0000 (21:27 +0200)]
gh-95273: Relocate sqlite3 enable load extension note (#95430)
Steve Dower [Fri, 29 Jul 2022 16:24:56 +0000 (17:24 +0100)]
gh-94302: Clarify use of the 'open' operation in os.startfile (GH-95441)
Christian Heimes [Fri, 29 Jul 2022 14:42:09 +0000 (16:42 +0200)]
gh-95415: Make availability directive consistent (GH-95416)
Erlend Egeberg Aasland [Fri, 29 Jul 2022 12:31:41 +0000 (14:31 +0200)]
gh-95432: Fixup sqlite3 tutorial example (#95431)
- the insert statement should have five placeholders, not four
- missing ... in the multiline row list
Oleg Iarygin [Fri, 29 Jul 2022 11:48:11 +0000 (14:48 +0300)]
gh-94512: Fix forced arg format in AC-processed resource (GH-94515)
Erlend Egeberg Aasland [Fri, 29 Jul 2022 09:53:23 +0000 (11:53 +0200)]
gh-95273: Improve sqlite3 class descriptions (#95379)
Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
Erlend Egeberg Aasland [Fri, 29 Jul 2022 07:42:22 +0000 (09:42 +0200)]
gh-95273: Move sqlite3 executemany examples from reference to tutorial (#95351)
Erlend Egeberg Aasland [Fri, 29 Jul 2022 07:40:44 +0000 (09:40 +0200)]
gh-95273: Condense sqlite3 executescript example (#95383)
Eric Snow [Fri, 29 Jul 2022 01:23:47 +0000 (19:23 -0600)]
gh-94673: Add Per-Interpreter tp_weaklist for Static Builtin Types (#95302)
* Store tp_weaklist on the interpreter state for static builtin types.
* Factor out _PyStaticType_GET_WEAKREFS_LISTPTR().
* Add _PyStaticType_ClearWeakRefs().
* Add a comment about how _PyStaticType_ClearWeakRefs() loops.
* Document the change.
* Update Doc/whatsnew/3.12.rst
* Fix a typo.
BenjaminHelyer [Fri, 29 Jul 2022 00:09:51 +0000 (19:09 -0500)]
Improve documentation for adding datetime and timedelta (gh-95403)
Erlend Egeberg Aasland [Thu, 28 Jul 2022 23:04:26 +0000 (01:04 +0200)]
gh-89610: Add .pyi as a recognised extension for IDLE on macOS (#95393)
This allows opening stub files by double clicking on them in the Finder.
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Raghunandan Bhat [Thu, 28 Jul 2022 22:48:33 +0000 (18:48 -0400)]
gh-43414: os.get_terminal_size() now uses the actual file descriptor on Windows instead of mapping to standard handles (#93203)
Jingxuan He [Thu, 28 Jul 2022 22:42:51 +0000 (00:42 +0200)]
Fix misused variable that was preventing permutations of classes from being tested (GH-93935)
[object Object] [Thu, 28 Jul 2022 22:38:56 +0000 (15:38 -0700)]
gh-86128: Add warning to ThreadPoolExecutor docs about atexit behaviour (GH-94008)
Pamela Fox [Thu, 28 Jul 2022 22:32:16 +0000 (15:32 -0700)]
Fix Unicode doc and replace use of macro with PyMem_New function (GH-94088)
JustAnotherArchivist [Thu, 28 Jul 2022 22:12:27 +0000 (22:12 +0000)]
gh-59200: Clarify `PyLong_FromString` documentation (GH-94363)
Oleg Iarygin [Thu, 28 Jul 2022 22:09:46 +0000 (01:09 +0300)]
gh-94512: Fix forced arg format in AC-processed overlapped (GH-94516)
Steve Dower [Thu, 28 Jul 2022 20:11:17 +0000 (21:11 +0100)]
gh-95359: Fix py.exe launcher handling of per-user py.ini and command names (GH-95399)
Ken Jin [Thu, 28 Jul 2022 16:22:24 +0000 (00:22 +0800)]
Update link to faster cpython benchmarks (GH-95391)
Kumar Aditya [Thu, 28 Jul 2022 15:47:54 +0000 (21:17 +0530)]
GH-95097: fix `asyncio.run` for tasks without `uncancel` method (#95211)
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Irit Katriel [Thu, 28 Jul 2022 10:38:46 +0000 (11:38 +0100)]
gh-95369: add missing decref in error case of exception group's split (GH-95370)
Honglin Zhu [Thu, 28 Jul 2022 10:00:34 +0000 (18:00 +0800)]
gh-95355: Check tokens[0] after allocating memory (GH-95356)
#95355
Automerge-Triggered-By: GH:pablogsal
Thomas Grainger [Thu, 28 Jul 2022 09:20:10 +0000 (10:20 +0100)]
gh-95166: cancel map waited on future on timeout (GH-95169)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Mark Shannon [Thu, 28 Jul 2022 09:17:22 +0000 (10:17 +0100)]
GH-90081: Run python tracers at full speed (GH-95328)
Erlend Egeberg Aasland [Thu, 28 Jul 2022 05:38:36 +0000 (07:38 +0200)]
Docs: Fix refs & tweak wording in sqlite3 'Using shortcut methods'
Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
Serhiy Storchaka [Thu, 28 Jul 2022 04:40:36 +0000 (07:40 +0300)]
gh-94938: Fix errror detection of unexpected keyword arguments (GH-94999)
When keyword argument name is an instance of a str subclass with
overloaded methods __eq__ and __hash__, the former code could not find
the name of an extraneous keyword argument to report an error, and
_PyArg_UnpackKeywords() returned success without setting the
corresponding cell in the linearized arguments array. But since the number
of expected initialized cells is determined as the total number of passed
arguments, this lead to reading NULL as a keyword parameter value, that
caused SystemError or crash or other undesired behavior.
Christian Heimes [Wed, 27 Jul 2022 18:28:06 +0000 (20:28 +0200)]
gh-95174: Add pthread stubs for WASI (GH-95234)
Co-authored-by: Brett Cannon <brett@python.org>
Stéphane Bidoul [Wed, 27 Jul 2022 18:14:42 +0000 (20:14 +0200)]
gh-95339: update bundled pip to 22.2.1 (gh-95340)
Pablo Galindo Salgado [Wed, 27 Jul 2022 15:03:38 +0000 (16:03 +0100)]
gh-95324: Emit a warning if an object doesn't call PyObject_GC_UnTrack during deallocation in debug mode (#95325)
Christian Heimes [Wed, 27 Jul 2022 13:30:36 +0000 (15:30 +0200)]
gh-95174: Move WASIX logic into wasi-env (GH-95320)
wasi-env now sets WASIX flags. This allows us to control all build
parameter for wasm32-wasi buildbot from CPython repository.
Also export and improve SYSROOT parameter.
Erlend Egeberg Aasland [Wed, 27 Jul 2022 13:24:13 +0000 (15:24 +0200)]
gh-95273: Normalise sqlite3 reference wording (#95274)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
Kumar Aditya [Wed, 27 Jul 2022 13:05:29 +0000 (18:35 +0530)]
GH-93899: fix checks for eventfd flags (GH-95170)
Erlend Egeberg Aasland [Wed, 27 Jul 2022 12:46:21 +0000 (14:46 +0200)]
gh-94630: Fixup sqlite3 argument spec docs for connection execute* methods (#95319)
Kumar Aditya [Wed, 27 Jul 2022 12:03:50 +0000 (17:33 +0530)]
GH-95045: gc untrack _lsprof.Profiler before deallocating it (GH-95315)
Automerge-Triggered-By: GH:pablogsal
Jason R. Coombs [Wed, 27 Jul 2022 08:54:31 +0000 (04:54 -0400)]
gh-93963: Remove usage of deprecated interface from importlib.abc. (#95217)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Aivars Kalvāns [Wed, 27 Jul 2022 08:43:34 +0000 (11:43 +0300)]
gh-95005: Replace PyAccu with PyUnicodeWriter (gh-95006)
Christian Heimes [Wed, 27 Jul 2022 07:19:49 +0000 (09:19 +0200)]
gh-95280: Fix test_get_ciphers on systems without RSA key exchange (GH-95282)
Christian Heimes [Wed, 27 Jul 2022 06:19:23 +0000 (08:19 +0200)]
gh-95174: WASI: skip missing sockets functions (GH-95179)
Christian Heimes [Wed, 27 Jul 2022 06:18:34 +0000 (08:18 +0200)]
gh-95085: Promote Emscripten and WASI to PEP 11 tier 3 (GH-95086)
Erlend Egeberg Aasland [Wed, 27 Jul 2022 05:43:24 +0000 (07:43 +0200)]
gh-94635: Add sqlite3 'Introduction' and 'Tutorial' doc headings (#95269)
Eric Snow [Tue, 26 Jul 2022 23:26:43 +0000 (17:26 -0600)]
gh-94673: Add Per-Interpreter Storage for Static Builtin Types (#95255)
This is the last precursor to storing tp_subclasses (and tp_weaklist) on the interpreter state for static builtin types.
Here we add per-type storage on PyInterpreterState, but only for the static builtin types. This involves the following:
* add PyInterpreterState.types
* move PyInterpreterState.type_cache to it
* add a "num_builtins_initialized" field
* add a "builtins" field (a static array big enough for all the static builtin types)
* add _PyStaticType_GetState() to look up a static builtin type's state
* (temporarily) add PyTypeObject.tp_static_builtin_index (to hold the type's index into PyInterpreterState.types.builtins)
We will be eliminating tp_static_builtin_index in a later change.
Steve Dower [Tue, 26 Jul 2022 20:24:44 +0000 (21:24 +0100)]
gh-95285: py.exe launcher fails with short argv0 (GH-95295)
Christian Heimes [Tue, 26 Jul 2022 20:14:35 +0000 (22:14 +0200)]
gh-93678: Address stack exhaustion on WASI (GH-95296)
Christian Heimes [Tue, 26 Jul 2022 19:39:04 +0000 (21:39 +0200)]
gh-94801: Fix regression in configure's CPPFLAGS handling (GH-95288)
Erlend Egeberg Aasland [Tue, 26 Jul 2022 19:18:16 +0000 (21:18 +0200)]
gh-95291: Use import helper to improve sqlite3 audit tests (#95292)
Now the tests are correctly reported as skipped if sqlite3 is not available.
Roman Novak [Tue, 26 Jul 2022 14:48:58 +0000 (07:48 -0700)]
Fix minor docstring issues in `dataclasses.py`. (gh-93024)
Previously, when using `functools.wrap` around them (and inherit their docstrings), sphinx renders the docstrings badly and raises warnings about wrong indent.
Irit Katriel [Tue, 26 Jul 2022 13:36:30 +0000 (14:36 +0100)]
gh-93678: extract 'struct cfg_builder' from the compiler so that the CFG can be manipulated directly (GH-95107)
Irit Katriel [Tue, 26 Jul 2022 13:34:46 +0000 (14:34 +0100)]
gh-95259: add test for traceback with angle-bracketed filename (GH-95260)
Noam Cohen [Tue, 26 Jul 2022 11:34:15 +0000 (14:34 +0300)]
gh-95041: Fail syslog.syslog in case inner call to syslog.openlog fails (GH-95264)
Shantanu [Tue, 26 Jul 2022 09:43:09 +0000 (02:43 -0700)]
gh-95066: ast: Replace assert with ValueError (GH-95072)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Christian Heimes [Tue, 26 Jul 2022 09:16:51 +0000 (11:16 +0200)]
gh-95174: Handle missing dup() and constants in WASI (GH-95229)
- check for ``dup()`` libc function
- handle missing ``F_DUPFD`` in ``dup2()`` replacement function
- add workaround for WASI libc bug in MSG_TRUNC
- ESHUTDOWN is missing, use EPIPE instead
- POLLPRI is missing, define as 0 (no-op)
Christian Heimes [Tue, 26 Jul 2022 09:12:42 +0000 (11:12 +0200)]
gh-95205: Improve WASM README.md (GH-95267)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
Raymond Hettinger [Tue, 26 Jul 2022 07:23:33 +0000 (02:23 -0500)]
Statistics inv_cdf sync with corresponding random module normal distributions (#95265)
Nicolas Haller [Tue, 26 Jul 2022 07:06:06 +0000 (03:06 -0400)]
Clarifying the documentation on library/syslog (GH-92587)
Erlend Egeberg Aasland [Tue, 26 Jul 2022 06:29:18 +0000 (08:29 +0200)]
gh-95235: Add explicit parameter list to some sqlite3 methods (#95240)
Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
Serhiy Storchaka [Tue, 26 Jul 2022 06:12:10 +0000 (09:12 +0300)]
gh-95041: Fix several minor issues in syslog.openlog() (GH-95058)
* syslog_get_argv() swallows exceptions, but not in all cases.
* if ident is non UTF-8 encodable, syslog.openlog() fails after setting the
global reference to ident. Now the C string saved internally in the previous
call to openlog() points to the freed memory.
* PySys_Audit() can crash if ident is NULL.
* There may be a race condition with syslog.syslog(), because the global
reference to ident is decrefed before setting the new value.
* Possible use of freed memory if syslog.openlog() is called while
the GIL is released in syslog.syslog().
Pieter Eendebak [Tue, 26 Jul 2022 02:10:23 +0000 (04:10 +0200)]
gh-91247: Use memcpy for list and tuple repeat (#91482)
* Add _Py_memory_repeat function to pycore_list
* Add _Py_RefcntAdd function to pycore_object
* Use the new functions in tuplerepeat, list_repeat, and list_inplace_repeat
Mark Shannon [Mon, 25 Jul 2022 21:30:53 +0000 (22:30 +0100)]
GH-92678: Expose managed dict clear and visit functions (#95246)
Eric Snow [Mon, 25 Jul 2022 20:23:41 +0000 (14:23 -0600)]
gh-94673: Always Finalize Static Builtin Types (#95153)
Static builtin types are finalized by calling _PyStaticType_Dealloc(). Before this change, we were skipping finalizing such a type if it still had subtypes (i.e. its tp_subclasses hadn't been cleared yet). The problem is that types hold several heap objects, which leak if we skip the type's finalization. This change addresses that.
For context, there's an old comment (from
e9e3eab0b86 ) that says the following:
// If a type still has subtypes, it cannot be deallocated.
// A subtype can inherit attributes and methods of its parent type,
// and a type must no longer be used once it's deallocated.
However, it isn't clear that is actually still true. Clearing tp_dict should mean it isn't a problem.
Furthermore, the only subtypes that might still be around come from extension modules that didn't clean them up when unloaded (i.e. extensions that do not implement multi-phase initialization, AKA PEP 489). Those objects are already leaking, so this change doesn't change anything in that regard. Instead, this change means more objects gets cleaned up that before.