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

Eric Snow webhook-mailer at python.org
Fri Jan 11 13:17:14 EST 2019


https://github.com/python/cpython/commit/a909460a09cca79bd051c45b02e650862a57dbd9
commit: a909460a09cca79bd051c45b02e650862a57dbd9
branch: master
author: Michael Felt <aixtools at users.noreply.github.com>
committer: Eric Snow <ericsnowcurrently at gmail.com>
date: 2019-01-11T11:17:03-07:00
summary:

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.

files:
A Misc/NEWS.d/next/Tests/2018-09-09-14-36-59.bpo-34569.okj1Xh.rst
M 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
index 000000000000..bd433adfc357
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2018-09-09-14-36-59.bpo-34569.okj1Xh.rst
@@ -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.
diff --git a/Python/pystate.c b/Python/pystate.c
index 98882eb7589c..4dc3b81e4cdb 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -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



More information about the Python-checkins mailing list