Skip to content

Commit f7003ed

Browse files
committed
symtable: remove unused import * checking code
The python developers agreed that this code was dead too http://bugs.python.org/issue24049
1 parent 7a5b132 commit f7003ed

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

symtable/symtable.go

-29
Original file line numberDiff line numberDiff line change
@@ -611,34 +611,6 @@ func (st *SymTable) DropClassFree(free StringSet) {
611611
}
612612
}
613613

614-
/* Check for illegal statements in unoptimized namespaces */
615-
func (st *SymTable) CheckUnoptimized() {
616-
if st.Type != FunctionBlock || st.Unoptimized == 0 || !(st.Free || st.ChildFree) {
617-
return
618-
}
619-
620-
// FIXME Acording to this
621-
// https://docs.python.org/3/whatsnew/3.0.html#removed-syntax
622-
//
623-
// The from module import * syntax is only allowed at the
624-
// module level, no longer inside functions.
625-
//
626-
// So I think this is dead code
627-
628-
trailer := "contains a nested function with free variables"
629-
if !st.ChildFree {
630-
trailer = "is a nested function"
631-
}
632-
633-
switch st.Unoptimized {
634-
case optTopLevel: /* import * at top-level is fine */
635-
return
636-
case optImportStar:
637-
panic(py.ExceptionNewf(py.SyntaxError, "import * is not allowed in function '%s' because it %s", st.Name, trailer))
638-
break
639-
}
640-
}
641-
642614
/* Enter the final scope information into the st.Symbols dict.
643615
*
644616
* All arguments are dicts. Modifies symbols, others are read-only.
@@ -771,7 +743,6 @@ func (st *SymTable) AnalyzeBlock(bound, free, global StringSet) {
771743
}
772744
/* Records the results of the analysis in the symbol table entry */
773745
st.Symbols.Update(scopes, bound, newfree, st.Type == ClassBlock)
774-
st.CheckUnoptimized()
775746

776747
free.Update(newfree)
777748
}

0 commit comments

Comments
 (0)