diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-06-13 01:40:00 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-06-13 01:40:00 (GMT) |
commit | 4afbba3d340655bb8be2a97b76fe689be7f0c013 (patch) | |
tree | 60357e254452ffe5f7256284a5858f5e6fb93ca2 /Python | |
parent | cb73bdac9565e7d4a9133635f802f446a915ca88 (diff) | |
download | cpython-4afbba3d340655bb8be2a97b76fe689be7f0c013.zip cpython-4afbba3d340655bb8be2a97b76fe689be7f0c013.tar.gz cpython-4afbba3d340655bb8be2a97b76fe689be7f0c013.tar.bz2 |
keep the slice.step field as NULL if no step expression is given
Diffstat (limited to 'Python')
-rw-r--r-- | Python/ast.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/Python/ast.c b/Python/ast.c index b3f4fcb..772047f 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -1468,14 +1468,7 @@ ast_for_slice(struct compiling *c, const node *n) ch = CHILD(n, NCH(n) - 1); if (TYPE(ch) == sliceop) { - if (NCH(ch) == 1) { - /* No expression, so step is None */ - ch = CHILD(ch, 0); - step = Name(new_identifier("None", c->c_arena), Load, - LINENO(ch), ch->n_col_offset, c->c_arena); - if (!step) - return NULL; - } else { + if (NCH(ch) != 1) { ch = CHILD(ch, 1); if (TYPE(ch) == test) { step = ast_for_expr(c, ch); |