summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2016-07-16 18:27:11 -0400
committerTerry Jan Reedy <tjreedy@udel.edu>2016-07-16 18:27:11 -0400
commit61537aeaa3e0a9548a16ce3bfc9c4dd629ce7211 (patch)
treefabfded1dfc58221baa18a9a5a21aa2add31933f /Python/pythonrun.c
parenta9ae1d67054fc0a8ad272082c41919044d1c1e9c (diff)
parent8f310e95a73a11c4184b7cd40bfb0d04609a171c (diff)
downloadcpython-61537aeaa3e0a9548a16ce3bfc9c4dd629ce7211.tar.gz
Issue #25507: Merge from 3.5 with ttk replacing colorchooser.
IDLE no longer runs buggy code because of its tkinter imports. Users must include the same imports required to run directly in Python.
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 7fbf06e68a..678ebfe5f6 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -431,7 +431,7 @@ static int
parse_syntax_error(PyObject *err, PyObject **message, PyObject **filename,
int *lineno, int *offset, PyObject **text)
{
- long hold;
+ int hold;
PyObject *v;
_Py_IDENTIFIER(msg);
_Py_IDENTIFIER(filename);
@@ -464,11 +464,11 @@ parse_syntax_error(PyObject *err, PyObject **message, PyObject **filename,
v = _PyObject_GetAttrId(err, &PyId_lineno);
if (!v)
goto finally;
- hold = PyLong_AsLong(v);
+ hold = _PyLong_AsInt(v);
Py_DECREF(v);
if (hold < 0 && PyErr_Occurred())
goto finally;
- *lineno = (int)hold;
+ *lineno = hold;
v = _PyObject_GetAttrId(err, &PyId_offset);
if (!v)
@@ -477,11 +477,11 @@ parse_syntax_error(PyObject *err, PyObject **message, PyObject **filename,
*offset = -1;
Py_DECREF(v);
} else {
- hold = PyLong_AsLong(v);
+ hold = _PyLong_AsInt(v);
Py_DECREF(v);
if (hold < 0 && PyErr_Occurred())
goto finally;
- *offset = (int)hold;
+ *offset = hold;
}
v = _PyObject_GetAttrId(err, &PyId_text);
@@ -791,11 +791,11 @@ print_exception(PyObject *f, PyObject *value)
PyErr_Clear();
}
-static const char *cause_message =
+static const char cause_message[] =
"\nThe above exception was the direct cause "
"of the following exception:\n\n";
-static const char *context_message =
+static const char context_message[] =
"\nDuring handling of the above exception, "
"another exception occurred:\n\n";
@@ -1144,8 +1144,8 @@ PyParser_ASTFromString(const char *s, const char *filename_str, int start,
mod_ty
PyParser_ASTFromFileObject(FILE *fp, PyObject *filename, const char* enc,
- int start, char *ps1,
- char *ps2, PyCompilerFlags *flags, int *errcode,
+ int start, const char *ps1,
+ const char *ps2, PyCompilerFlags *flags, int *errcode,
PyArena *arena)
{
mod_ty mod;
@@ -1177,8 +1177,8 @@ PyParser_ASTFromFileObject(FILE *fp, PyObject *filename, const char* enc,
mod_ty
PyParser_ASTFromFile(FILE *fp, const char *filename_str, const char* enc,
- int start, char *ps1,
- char *ps2, PyCompilerFlags *flags, int *errcode,
+ int start, const char *ps1,
+ const char *ps2, PyCompilerFlags *flags, int *errcode,
PyArena *arena)
{
mod_ty mod;