Commit 53195c1a authored by Guido van Rossum's avatar Guido van Rossum

Don't release the interpreter lock around PyParser_ParseFile().

It is needed so that tokenizer.c can use PySys_WriteStderr().
parent b9f48608
...@@ -500,10 +500,8 @@ PyRun_InteractiveOne(fp, filename) ...@@ -500,10 +500,8 @@ PyRun_InteractiveOne(fp, filename)
else if (PyString_Check(w)) else if (PyString_Check(w))
ps2 = PyString_AsString(w); ps2 = PyString_AsString(w);
} }
Py_BEGIN_ALLOW_THREADS
n = PyParser_ParseFile(fp, filename, &_PyParser_Grammar, n = PyParser_ParseFile(fp, filename, &_PyParser_Grammar,
Py_single_input, ps1, ps2, &err); Py_single_input, ps1, ps2, &err);
Py_END_ALLOW_THREADS
Py_XDECREF(v); Py_XDECREF(v);
Py_XDECREF(w); Py_XDECREF(w);
if (n == NULL) { if (n == NULL) {
...@@ -942,10 +940,8 @@ PyParser_SimpleParseFile(fp, filename, start) ...@@ -942,10 +940,8 @@ PyParser_SimpleParseFile(fp, filename, start)
{ {
node *n; node *n;
perrdetail err; perrdetail err;
Py_BEGIN_ALLOW_THREADS
n = PyParser_ParseFile(fp, filename, &_PyParser_Grammar, start, n = PyParser_ParseFile(fp, filename, &_PyParser_Grammar, start,
(char *)0, (char *)0, &err); (char *)0, (char *)0, &err);
Py_END_ALLOW_THREADS
if (n == NULL) if (n == NULL)
err_input(&err); err_input(&err);
return n; return n;
......
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