summaryrefslogtreecommitdiffstats
path: root/Python/future.c
diff options
context:
space:
mode:
authorINADA Naoki <methane@users.noreply.github.com>2017-02-22 15:31:59 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2017-02-22 15:31:59 (GMT)
commitcb41b2766de646435743b6af7dd152751b54e73f (patch)
tree4033a04617524787defe4699c45327783fe44d8d /Python/future.c
parent1bc156430bad8177b5beecf57979628c1d071230 (diff)
downloadcpython-cb41b2766de646435743b6af7dd152751b54e73f.zip
cpython-cb41b2766de646435743b6af7dd152751b54e73f.tar.gz
cpython-cb41b2766de646435743b6af7dd152751b54e73f.tar.bz2
bpo-29463: Add docstring field to some AST nodes. (#46)
* bpo-29463: Add docstring field to some AST nodes. ClassDef, ModuleDef, FunctionDef, and AsyncFunctionDef has docstring field for now. It was first statement of there body. * fix document. thanks travis! * doc fixes
Diffstat (limited to 'Python/future.c')
-rw-r--r--Python/future.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/Python/future.c b/Python/future.c
index 9c1f430..5cb21ac 100644
--- a/Python/future.c
+++ b/Python/future.c
@@ -61,7 +61,6 @@ static int
future_parse(PyFutureFeatures *ff, mod_ty mod, PyObject *filename)
{
int i, done = 0, prev_line = 0;
- stmt_ty first;
if (!(mod->kind == Module_kind || mod->kind == Interactive_kind))
return 1;
@@ -77,16 +76,7 @@ future_parse(PyFutureFeatures *ff, mod_ty mod, PyObject *filename)
but is preceded by a regular import.
*/
- i = 0;
- first = (stmt_ty)asdl_seq_GET(mod->v.Module.body, i);
- if (first->kind == Expr_kind
- && (first->v.Expr.value->kind == Str_kind
- || (first->v.Expr.value->kind == Constant_kind
- && PyUnicode_CheckExact(first->v.Expr.value->v.Constant.value))))
- i++;
-
-
- for (; i < asdl_seq_LEN(mod->v.Module.body); i++) {
+ for (i = 0; i < asdl_seq_LEN(mod->v.Module.body); i++) {
stmt_ty s = (stmt_ty)asdl_seq_GET(mod->v.Module.body, i);
if (done && s->lineno > prev_line)