Skip to content

Commit ddbf6f0

Browse files
committed
Merge remote-tracking branch 'origin/main' into android-minsdk-24
2 parents 55cfb94 + e68d4b0 commit ddbf6f0

File tree

27 files changed

+43
-142
lines changed

27 files changed

+43
-142
lines changed

Doc/tools/static/rtd_switcher.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
document.addEventListener("readthedocs-addons-data-ready", function(event) {
88
const config = event.detail.data()
99
const versionSelect = `
10-
<select id="version_select">
10+
<select id="version_select" aria-label="Python version">
1111
${ config.versions.active.map(
1212
(version) => `
1313
<option
@@ -25,7 +25,7 @@
2525
languages = languages.sort((a, b) => a.language.name.localeCompare(b.language.name));
2626

2727
const languageSelect = `
28-
<select id="language_select">
28+
<select id="language_select" aria-label="Language">
2929
${ languages.map(
3030
(translation) => `
3131
<option

Include/internal/pycore_gc.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -342,14 +342,6 @@ struct _gc_runtime_state {
342342
collections, and are awaiting to undergo a full collection for
343343
the first time. */
344344
Py_ssize_t long_lived_pending;
345-
346-
/* gh-117783: Deferred reference counting is not fully implemented yet, so
347-
as a temporary measure we treat objects using deferred reference
348-
counting as immortal. The value may be zero, one, or a negative number:
349-
0: immortalize deferred RC objects once the first thread is created
350-
1: immortalize all deferred RC objects immediately
351-
<0: suppressed; don't immortalize objects */
352-
int immortalize;
353345
#endif
354346
};
355347

Include/internal/pycore_tstate.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ typedef struct _PyThreadStateImpl {
4141
// If set, don't use per-thread refcounts
4242
int is_finalized;
4343
} refcounts;
44+
45+
// When >1, code objects do not immortalize their non-string constants.
46+
int suppress_co_const_immortalization;
4447
#endif
4548

4649
#if defined(Py_REF_DEBUG) && defined(Py_GIL_DISABLED)

Lib/collections/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
import _collections_abc
3030
import sys as _sys
3131

32+
_sys.modules['collections.abc'] = _collections_abc
33+
abc = _collections_abc
34+
3235
from itertools import chain as _chain
3336
from itertools import repeat as _repeat
3437
from itertools import starmap as _starmap

Lib/collections/abc.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

Lib/test/libregrtest/main.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
import time
88
import trace
99

10-
from test.support import (os_helper, MS_WINDOWS, flush_std_streams,
11-
suppress_immortalization)
10+
from test.support import os_helper, MS_WINDOWS, flush_std_streams
1211

1312
from .cmdline import _parse_args, Namespace
1413
from .findtests import findtests, split_test_packages, list_cases
@@ -535,10 +534,7 @@ def _run_tests(self, selected: TestTuple, tests: TestList | None) -> int:
535534
if self.num_workers:
536535
self._run_tests_mp(runtests, self.num_workers)
537536
else:
538-
# gh-117783: don't immortalize deferred objects when tracking
539-
# refleaks. Only relevant for the free-threaded build.
540-
with suppress_immortalization(runtests.hunt_refleak):
541-
self.run_tests_sequentially(runtests)
537+
self.run_tests_sequentially(runtests)
542538

543539
coverage = self.results.get_coverage_results()
544540
self.display_result(runtests)

Lib/test/libregrtest/single.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,7 @@ def run_single_test(test_name: TestName, runtests: RunTests) -> TestResult:
304304
result = TestResult(test_name)
305305
pgo = runtests.pgo
306306
try:
307-
# gh-117783: don't immortalize deferred objects when tracking
308-
# refleaks. Only relevant for the free-threaded build.
309-
with support.suppress_immortalization(runtests.hunt_refleak):
310-
_runtest(result, runtests)
307+
_runtest(result, runtests)
311308
except:
312309
if not pgo:
313310
msg = traceback.format_exc()

Lib/test/seq_tests.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,6 @@ def test_pickle(self):
426426
self.assertEqual(lst2, lst)
427427
self.assertNotEqual(id(lst2), id(lst))
428428

429-
@support.suppress_immortalization()
430429
def test_free_after_iterating(self):
431430
support.check_free_after_iterating(self, iter, self.type2test)
432431
support.check_free_after_iterating(self, reversed, self.type2test)

Lib/test/support/__init__.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -512,33 +512,6 @@ def has_no_debug_ranges():
512512
def requires_debug_ranges(reason='requires co_positions / debug_ranges'):
513513
return unittest.skipIf(has_no_debug_ranges(), reason)
514514

515-
@contextlib.contextmanager
516-
def suppress_immortalization(suppress=True):
517-
"""Suppress immortalization of deferred objects."""
518-
try:
519-
import _testinternalcapi
520-
except ImportError:
521-
yield
522-
return
523-
524-
if not suppress:
525-
yield
526-
return
527-
528-
_testinternalcapi.suppress_immortalization(True)
529-
try:
530-
yield
531-
finally:
532-
_testinternalcapi.suppress_immortalization(False)
533-
534-
def skip_if_suppress_immortalization():
535-
try:
536-
import _testinternalcapi
537-
except ImportError:
538-
return
539-
return unittest.skipUnless(_testinternalcapi.get_immortalize_deferred(),
540-
"requires immortalization of deferred objects")
541-
542515

543516
MS_WINDOWS = (sys.platform == 'win32')
544517

Lib/test/test_ast/test_ast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2259,7 +2259,7 @@ def test_validation(self):
22592259
"got an invalid type in Constant: list")
22602260

22612261
def test_singletons(self):
2262-
for const in (None, False, True, Ellipsis, b'', frozenset()):
2262+
for const in (None, False, True, Ellipsis, b''):
22632263
with self.subTest(const=const):
22642264
value = self.compile_constant(const)
22652265
self.assertIs(value, const)

0 commit comments

Comments
 (0)