Skip to content

Commit 7a95398

Browse files
committed
let the simple cpyext demo work on sandboxed
1 parent f0ae080 commit 7a95398

File tree

1 file changed

+5
-1
lines changed
  • graalpython/com.oracle.graal.python.test/src/tests/cpyext

1 file changed

+5
-1
lines changed

graalpython/com.oracle.graal.python.test/src/tests/cpyext/demo.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ static PyObject* demo_system(PyObject *self, PyObject *args)
4949

5050
if (!PyArg_ParseTuple(args, "s", &command))
5151
return NULL;
52-
sts = system(command);
52+
if (!strcmp("echo 1", command)) {
53+
sts = 0;
54+
} else {
55+
sts = 1;
56+
}
5357
return Py_BuildValue("i", sts);
5458
}
5559

0 commit comments

Comments
 (0)