summaryrefslogtreecommitdiff
path: root/Python/symtable.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2015-04-24 12:02:29 -0400
committerBenjamin Peterson <benjamin@python.org>2015-04-24 12:02:29 -0400
commit040ee2b834a18d6cc9c0db3ba14fe968b1b063cc (patch)
tree6a3fb40e6420ce635f1cac5f686e9765a53c9e83 /Python/symtable.c
parentad8d68f81a438737a4a1f0b43fd19f219385ad6d (diff)
downloadcpython-040ee2b834a18d6cc9c0db3ba14fe968b1b063cc.tar.gz
remove dead *-import checking code (closes #24049)
Diffstat (limited to 'Python/symtable.c')
-rw-r--r--Python/symtable.c31
1 files changed, 0 insertions, 31 deletions
diff --git a/Python/symtable.c b/Python/symtable.c
index da164aa877..951267342b 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -583,35 +583,6 @@ drop_class_free(PySTEntryObject *ste, PyObject *free)
return 1;
}
-/* Check for illegal statements in unoptimized namespaces */
-static int
-check_unoptimized(const PySTEntryObject* ste) {
- const char* trailer;
-
- if (ste->ste_type != FunctionBlock || !ste->ste_unoptimized
- || !(ste->ste_free || ste->ste_child_free))
- return 1;
-
- trailer = (ste->ste_child_free ?
- "contains a nested function with free variables" :
- "is a nested function");
-
- switch (ste->ste_unoptimized) {
- case OPT_TOPLEVEL: /* import * at top-level is fine */
- return 1;
- case OPT_IMPORT_STAR:
- PyErr_Format(PyExc_SyntaxError,
- "import * is not allowed in function '%U' because it %s",
- ste->ste_name, trailer);
- break;
- }
-
- PyErr_SyntaxLocationObject(ste->ste_table->st_filename,
- ste->ste_opt_lineno,
- ste->ste_opt_col_offset);
- return 0;
-}
-
/* Enter the final scope information into the ste_symbols dict.
*
* All arguments are dicts. Modifies symbols, others are read-only.
@@ -854,8 +825,6 @@ analyze_block(PySTEntryObject *ste, PyObject *bound, PyObject *free,
if (!update_symbols(ste->ste_symbols, scopes, bound, newfree,
ste->ste_type == ClassBlock))
goto error;
- if (!check_unoptimized(ste))
- goto error;
temp = PyNumber_InPlaceOr(free, newfree);
if (!temp)