mirror of
https://github.com/python/cpython.git
synced 2025-07-27 21:24:32 +00:00
when no module is given in a 'from' relative import, make ImportFrom.module NULL
This commit is contained in:
parent
52c4bec76b
commit
a72be3b325
6 changed files with 28 additions and 21 deletions
|
@ -2440,7 +2440,7 @@ ast_for_import_stmt(struct compiling *c, const node *n)
|
|||
int n_children;
|
||||
int idx, ndots = 0;
|
||||
alias_ty mod = NULL;
|
||||
identifier modname;
|
||||
identifier modname = NULL;
|
||||
|
||||
/* Count the number of dots (for relative imports) and check for the
|
||||
optional module name */
|
||||
|
@ -2504,8 +2504,6 @@ ast_for_import_stmt(struct compiling *c, const node *n)
|
|||
}
|
||||
if (mod != NULL)
|
||||
modname = mod->name;
|
||||
else
|
||||
modname = new_identifier("", c->c_arena);
|
||||
return ImportFrom(modname, aliases, ndots, lineno, col_offset,
|
||||
c->c_arena);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue