Skip to content

Commit 52310f0

Browse files
Merge branch '3.13' into hy/fix_issue_134163
2 parents 932c15e + 614c493 commit 52310f0

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

Doc/library/gc.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ The :mod:`gc` module provides the following functions:
113113
been examined more than *threshold1* times since generation ``1`` has been
114114
examined, then generation ``1`` is examined as well.
115115
With the third generation, things are a bit more complicated,
116-
see `Collecting the oldest generation <https://devguide.python.org/garbage_collector/#collecting-the-oldest-generation>`_ for more information.
116+
see `Collecting the oldest generation <https://github.com/python/cpython/blob/ff0ef0a54bef26fc507fbf9b7a6009eb7d3f17f5/InternalDocs/garbage_collector.md#collecting-the-oldest-generation>`_ for more information.
117117

118118

119119
.. function:: get_count()

Lib/multiprocessing/popen_spawn_posix.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ def _launch(self, process_obj):
5757
self._fds.extend([child_r, child_w])
5858
self.pid = util.spawnv_passfds(spawn.get_executable(),
5959
cmd, self._fds)
60+
os.close(child_r)
61+
child_r = None
62+
os.close(child_w)
63+
child_w = None
6064
self.sentinel = parent_r
6165
with open(parent_w, 'wb', closefd=False) as f:
6266
f.write(fp.getbuffer())

Lib/test/list_tests.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ def test_init(self):
3131
self.assertEqual(a, b)
3232

3333
def test_getitem_error(self):
34-
a = []
34+
a = self.type2test([])
3535
msg = "list indices must be integers or slices"
3636
with self.assertRaisesRegex(TypeError, msg):
3737
a['a']
3838

3939
def test_setitem_error(self):
40-
a = []
40+
a = self.type2test([])
4141
msg = "list indices must be integers or slices"
4242
with self.assertRaisesRegex(TypeError, msg):
4343
a['a'] = "python"
@@ -558,7 +558,7 @@ def test_constructor_exception_handling(self):
558558
class F(object):
559559
def __iter__(self):
560560
raise KeyboardInterrupt
561-
self.assertRaises(KeyboardInterrupt, list, F())
561+
self.assertRaises(KeyboardInterrupt, self.type2test, F())
562562

563563
def test_exhausted_iterator(self):
564564
a = self.type2test([1, 2, 3])
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix potential hang in ``multiprocessing.popen_spawn_posix`` that can happen
2+
when the child proc dies early by closing the child fds right away.

0 commit comments

Comments
 (0)