summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-12-23 00:09:01 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2015-12-23 00:09:01 +0200
commit5763ed39e7cbddf4e95ef9664e4b935b7624cd87 (patch)
tree5f3dc7fbc3ed860d383a64b39f1c58e801245f14 /Python/pythonrun.c
parent150125ef6aad88309035a2ce7c3bebc3e0a6536e (diff)
parentb0de0349855d6dbf55bb8328367b0e8e2bf5bf14 (diff)
downloadcpython-5763ed39e7cbddf4e95ef9664e4b935b7624cd87.tar.gz
Issue #25860: os.fwalk() no longer skips remaining directories when error occurs.
Original patch by Samson Lee.
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index ebedd123f3..1a5dab5f3a 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);