summaryrefslogtreecommitdiffstats
path: root/Modules/posixmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r--Modules/posixmodule.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index a5eb866..d863f9f 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -5773,6 +5773,13 @@ os_execv_impl(PyObject *module, path_t *path, PyObject *argv)
EXECV_CHAR **argvlist;
Py_ssize_t argc;
+ PyInterpreterState *interp = _PyInterpreterState_GET();
+ if (!_PyInterpreterState_HasFeature(interp, Py_RTFLAGS_EXEC)) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "exec not supported for isolated subinterpreters");
+ return NULL;
+ }
+
/* execv has two arguments: (path, argv), where
argv is a list or tuple of strings. */
@@ -5839,6 +5846,13 @@ os_execve_impl(PyObject *module, path_t *path, PyObject *argv, PyObject *env)
EXECV_CHAR **envlist;
Py_ssize_t argc, envc;
+ PyInterpreterState *interp = _PyInterpreterState_GET();
+ if (!_PyInterpreterState_HasFeature(interp, Py_RTFLAGS_EXEC)) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "exec not supported for isolated subinterpreters");
+ return NULL;
+ }
+
/* execve has three arguments: (path, argv, env), where
argv is a list or tuple of strings and env is a dictionary
like posix.environ. */