summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wouters <thomas@python.org>2006-02-27 17:14:45 (GMT)
committerThomas Wouters <thomas@python.org>2006-02-27 17:14:45 (GMT)
commit8622e93eab3583a7ab4d6018cd9816bb1deef338 (patch)
tree2431b678fece06a89945d61e1299e3d8a62c8668
parent106203c6e0a70e26e85edb6460327d815f49511a (diff)
downloadcpython-8622e93eab3583a7ab4d6018cd9816bb1deef338.zip
cpython-8622e93eab3583a7ab4d6018cd9816bb1deef338.tar.gz
cpython-8622e93eab3583a7ab4d6018cd9816bb1deef338.tar.bz2
And some more cleanup.
-rw-r--r--Python/ast.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/ast.c b/Python/ast.c
index 54bdacc..5594ef3 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -2154,7 +2154,7 @@ ast_for_import_stmt(struct compiling *c, const node *n)
REQ(n, import_stmt);
n = CHILD(n, 0);
- if (STR(CHILD(n, 0))[0] == 'i') { /* import */
+ if (TYPE(n) == import_name) {
n = CHILD(n, 1);
REQ(n, dotted_as_names);
aliases = asdl_seq_new((NCH(n) + 1) / 2, c->c_arena);
@@ -2168,7 +2168,7 @@ ast_for_import_stmt(struct compiling *c, const node *n)
}
return Import(aliases, LINENO(n), c->c_arena);
}
- else if (STR(CHILD(n, 0))[0] == 'f') { /* from */
+ else if (TYPE(n) == import_from) {
int n_children;
int lineno = LINENO(n);
alias_ty mod = alias_for_import_name(c, CHILD(n, 1));