[Python-checkins] commit of r41625 - python/branches/ast-objects/Python/compile.c
neal.norwitz
python-checkins at python.org
Tue Dec 6 08:35:12 CET 2005
Author: neal.norwitz
Date: Tue Dec 6 08:35:11 2005
New Revision: 41625
Modified:
python/branches/ast-objects/Python/compile.c
Log:
Simplify logic for handling import *
Modified: python/branches/ast-objects/Python/compile.c
==============================================================================
--- python/branches/ast-objects/Python/compile.c (original)
+++ python/branches/ast-objects/Python/compile.c Tue Dec 6 08:35:11 2005
@@ -2440,7 +2440,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)
@@ -2474,8 +2473,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);
@@ -2488,9 +2486,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