]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-34569: Fix subinterpreter 32-bit ABI, pystate.c/_new_long_object() (gh-9127)
authorMichael Felt <aixtools@users.noreply.github.com>
Fri, 11 Jan 2019 18:17:03 +0000 (19:17 +0100)
committerEric Snow <ericsnowcurrently@gmail.com>
Fri, 11 Jan 2019 18:17:03 +0000 (11:17 -0700)
This fixes ShareableTypeTests.test_int() in Lib/test/test__xxsubinterpreters.py.

Misc/NEWS.d/next/Tests/2018-09-09-14-36-59.bpo-34569.okj1Xh.rst [new file with mode: 0644]
Python/pystate.c

diff --git a/Misc/NEWS.d/next/Tests/2018-09-09-14-36-59.bpo-34569.okj1Xh.rst b/Misc/NEWS.d/next/Tests/2018-09-09-14-36-59.bpo-34569.okj1Xh.rst
new file mode 100644 (file)
index 0000000..bd433ad
--- /dev/null
@@ -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.
index 98882eb7589c6f552d7a6152ddc931f1a7fe8c1d..4dc3b81e4cdb97285af248fc9b4e903d623eb942 100644 (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