cpython: eb47af6e9e22 (original) (raw)

Mercurial > cpython

changeset 74471:eb47af6e9e22 3.2

Test running of code in a sub-interpreter (prelude to issue #6531). [#6531]

Antoine Pitrou solipsis@pitrou.net
date Wed, 18 Jan 2012 00:21:11 +0100
parents f715c4a5a107
children a108818aaa0d eed73b16e71f
files Lib/test/test_capi.py Modules/_testcapimodule.c
diffstat 2 files changed, 44 insertions(+), 0 deletions(-)[+] [-] Lib/test/test_capi.py 17 Modules/_testcapimodule.c 27

line wrap: on

line diff

--- a/Lib/test/test_capi.py +++ b/Lib/test/test_capi.py @@ -3,6 +3,7 @@ from future import with_statement import os +import pickle import random import subprocess import sys @@ -137,6 +138,22 @@ class TestPendingCalls(unittest.TestCase self.pendingcalls_submit(l, n) self.pendingcalls_wait(l, n)

+

Bug #6012

class Test6012(unittest.TestCase): def test(self):

--- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -2300,6 +2300,32 @@ crash_no_current_thread(PyObject self) return NULL; } +/ To run some code in a sub-interpreter. */ +static PyObject * +run_in_subinterp(PyObject *self, PyObject *args) +{

+

+

+

+

+

+

+} + + static PyMethodDef TestMethods[] = { {"raise_exception", raise_exception, METH_VARARGS}, {"raise_memoryerror", (PyCFunction)raise_memoryerror, METH_NOARGS}, @@ -2385,6 +2411,7 @@ static PyMethodDef TestMethods[] = { {"make_memoryview_from_NULL_pointer", (PyCFunction)make_memoryview_from_NULL_pointer, METH_NOARGS}, {"crash_no_current_thread", (PyCFunction)crash_no_current_thread, METH_NOARGS},