Commit b9d15796 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Get input() working

parent c79cce9f
...@@ -1712,8 +1712,8 @@ Box* rawInput(Box* prompt) { ...@@ -1712,8 +1712,8 @@ Box* rawInput(Box* prompt) {
} }
Box* input(Box* prompt) { Box* input(Box* prompt) {
assert(0 && "check refcounting");
PyObject* line = rawInput(prompt); PyObject* line = rawInput(prompt);
AUTO_DECREF(line);
char* str = NULL; char* str = NULL;
if (!PyArg_Parse(line, "s;embedded '\\0' in input line", &str)) if (!PyArg_Parse(line, "s;embedded '\\0' in input line", &str))
...@@ -1722,7 +1722,7 @@ Box* input(Box* prompt) { ...@@ -1722,7 +1722,7 @@ Box* input(Box* prompt) {
while (*str == ' ' || *str == '\t') while (*str == ' ' || *str == '\t')
str++; str++;
Box* gbls = globals(); Box* gbls = PyEval_GetGlobals();
Box* lcls = PyEval_GetLocals(); Box* lcls = PyEval_GetLocals();
// CPython has these safety checks that the builtin functions exist // CPython has these safety checks that the builtin functions exist
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment