Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-76785: Add More Tests to test_interpreters.test_api #117662

Merged
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
bdd8d70
InterpreterError inherits from Exception.
ericsnowcurrently Apr 8, 2024
940f24d
Add _PyInterpreterState_GetIDObject().
ericsnowcurrently Apr 5, 2024
528c6e3
Add _PyXI_NewInterpreter() and _PyXI_EndInterpreter().
ericsnowcurrently Apr 5, 2024
0bd2e6b
Add _testinternalcapi.next_interpreter_id().
ericsnowcurrently Apr 1, 2024
76e32cd
Add _testinternalcapi.exec_interpreter().
ericsnowcurrently Apr 8, 2024
9b7bdc4
Sketch out tests.
ericsnowcurrently Mar 22, 2024
fa28f9b
Flesh out the tests.
ericsnowcurrently Mar 27, 2024
5e31f6e
Add PipeEnd.
ericsnowcurrently Mar 28, 2024
9111a83
Refactor _captured_script().
ericsnowcurrently Mar 28, 2024
0c24e5c
Finish the tests.
ericsnowcurrently Mar 28, 2024
611fa31
Add missing tests.
ericsnowcurrently Apr 1, 2024
bdc09f9
Add more capture/exec helpers.
ericsnowcurrently Apr 8, 2024
be85ff5
Fill out the tests.
ericsnowcurrently Apr 8, 2024
51f18f8
Adjust the tests.
ericsnowcurrently Apr 8, 2024
b1f96d2
Fix clean_up_interpreters().
ericsnowcurrently Apr 9, 2024
cd61643
Fix test_capi.test_misc.
ericsnowcurrently Apr 9, 2024
7de523d
external/unmanaged -> from_capi
ericsnowcurrently Apr 9, 2024
11d38ab
Add a missing decorator.
ericsnowcurrently Apr 9, 2024
1cf31b6
Fix other tests.
ericsnowcurrently Apr 9, 2024
4421169
Fix test_capi.
ericsnowcurrently Apr 9, 2024
c75a115
Add _interpreters.capture_exception().
ericsnowcurrently Apr 9, 2024
b00476d
Raise ExecutionFailed when possible.
ericsnowcurrently Apr 9, 2024
6a82a33
Handle OSError in the _running() script.
ericsnowcurrently Apr 9, 2024
11dae3d
Add PyInterpreterState._whence.
ericsnowcurrently Apr 10, 2024
7c9a2b9
Fix up _testinternalcapi.
ericsnowcurrently Apr 10, 2024
e68654c
Add PyInterpreterState.initialized.
ericsnowcurrently Apr 10, 2024
175080c
Add tests for whence.
ericsnowcurrently Apr 10, 2024
9db5a2b
Set interp-_ready on the main interpreter.
ericsnowcurrently Apr 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
InterpreterError inherits from Exception.
ericsnowcurrently committed Apr 8, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit bdd8d70ba1ff535a153a1f8ef2b2a08dad100116
12 changes: 6 additions & 6 deletions Python/crossinterp_exceptions.h
Original file line number Diff line number Diff line change
@@ -6,9 +6,9 @@ static PyTypeObject _PyExc_InterpreterError = {
.tp_name = "interpreters.InterpreterError",
.tp_doc = PyDoc_STR("A cross-interpreter operation failed"),
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
//.tp_traverse = ((PyTypeObject *)PyExc_BaseException)->tp_traverse,
//.tp_clear = ((PyTypeObject *)PyExc_BaseException)->tp_clear,
//.tp_base = (PyTypeObject *)PyExc_BaseException,
//.tp_traverse = ((PyTypeObject *)PyExc_Exception)->tp_traverse,
//.tp_clear = ((PyTypeObject *)PyExc_Exception)->tp_clear,
//.tp_base = (PyTypeObject *)PyExc_Exception,
};
PyObject *PyExc_InterpreterError = (PyObject *)&_PyExc_InterpreterError;

@@ -19,8 +19,8 @@ static PyTypeObject _PyExc_InterpreterNotFoundError = {
.tp_name = "interpreters.InterpreterNotFoundError",
.tp_doc = PyDoc_STR("An interpreter was not found"),
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
//.tp_traverse = ((PyTypeObject *)PyExc_BaseException)->tp_traverse,
//.tp_clear = ((PyTypeObject *)PyExc_BaseException)->tp_clear,
//.tp_traverse = ((PyTypeObject *)PyExc_Exception)->tp_traverse,
//.tp_clear = ((PyTypeObject *)PyExc_Exception)->tp_clear,
.tp_base = &_PyExc_InterpreterError,
};
PyObject *PyExc_InterpreterNotFoundError = (PyObject *)&_PyExc_InterpreterNotFoundError;
@@ -61,7 +61,7 @@ _get_not_shareable_error_type(PyInterpreterState *interp)
static int
init_exceptions(PyInterpreterState *interp)
{
PyTypeObject *base = (PyTypeObject *)PyExc_BaseException;
PyTypeObject *base = (PyTypeObject *)PyExc_Exception;

// builtin static types