bpo-34569: Fix subinterpreter 32-bit ABI, pystate.c/_new_long_object() (gh-9127)

This fixes ShareableTypeTests.test_int() in Lib/test/test__xxsubinterpreters.py.
This commit is contained in:
Michael Felt 2019-01-11 19:17:03 +01:00 committed by Eric Snow
parent 2a39d251f0
commit a909460a09
2 changed files with 3 additions and 1 deletions

View File

@ -0,0 +1,2 @@
The experimental PEP 554 data channels now correctly pass negative PyLong
objects between subinterpreters on 32-bit systems. Patch by Michael Felt.

View File

@ -1467,7 +1467,7 @@ _str_shared(PyObject *obj, _PyCrossInterpreterData *data)
static PyObject *
_new_long_object(_PyCrossInterpreterData *data)
{
return PyLong_FromLongLong((int64_t)(data->data));
return PyLong_FromLongLong((intptr_t)(data->data));
}
static int