[Python-checkins] commit of r41624 - python/branches/ast-arena/Python/compile.c
neal.norwitz
python-checkins at python.org
Tue Dec 6 08:35:06 CET 2005
Author: neal.norwitz
Date: Tue Dec 6 08:35:05 2005
New Revision: 41624
Modified:
python/branches/ast-arena/Python/compile.c
Log:
Simplify logic for handling import *
Modified: python/branches/ast-arena/Python/compile.c
==============================================================================
--- python/branches/ast-arena/Python/compile.c (original)
+++ python/branches/ast-arena/Python/compile.c Tue Dec 6 08:35:05 2005
@@ -2445,7 +2445,6 @@
compiler_from_import(struct compiler *c, stmt_ty s)
{
int i, n = asdl_seq_LEN(s->v.ImportFrom.names);
- int star = 0;
PyObject *names = PyTuple_New(n);
if (!names)
@@ -2479,8 +2478,7 @@
if (i == 0 && *PyString_AS_STRING(alias->name) == '*') {
assert(n == 1);
ADDOP(c, IMPORT_STAR);
- star = 1;
- break;
+ return 1;
}
ADDOP_NAME(c, IMPORT_FROM, alias->name, names);
@@ -2493,9 +2491,8 @@
return 0;
}
}
- if (!star)
- /* remove imported module */
- ADDOP(c, POP_TOP);
+ /* remove imported module */
+ ADDOP(c, POP_TOP);
return 1;
}
More information about the Python-checkins
mailing list