Skip to content

Commit 62842c9

Browse files
[3.15] gh-152156: Fix a crash in interpeters.create under limited memory conditions (GH-152163) (#152269)
gh-152156: Fix a crash in `interpeters.create` under limited memory conditions (GH-152163) (cherry picked from commit 3ad66bf) Co-authored-by: sobolevn <mail@sobolevn.me>
1 parent 41f5b92 commit 62842c9

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix a possible crash in :func:`concurrent.interpreters.create` under limited
2+
memory conditions.

Modules/_interpchannelsmodule.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2951,10 +2951,8 @@ channelsmod_create(PyObject *self, PyObject *args, PyObject *kwds)
29512951
&cidobj);
29522952
if (handle_channel_error(err, self, cid)) {
29532953
assert(cidobj == NULL);
2954-
err = channel_destroy(&_globals.channels, cid);
2955-
if (handle_channel_error(err, self, cid)) {
2956-
// XXX issue a warning?
2957-
}
2954+
assert(PyErr_Occurred());
2955+
(void)channel_destroy(&_globals.channels, cid);
29582956
return NULL;
29592957
}
29602958
assert(cidobj != NULL);

0 commit comments

Comments
 (0)