Fix scope_for_name to catch NameError properly

This commit is contained in:
Dong-hee Na 2019-08-12 00:32:57 +09:00
parent fde382409c
commit 5135c696e7
2 changed files with 5 additions and 5 deletions

View file

@ -1877,7 +1877,9 @@ impl<O: OutputStream> Compiler<O> {
fn lookup_name(&self, name: &str) -> &Symbol {
// println!("Looking up {:?}", name);
let scope = self.scope_stack.last().unwrap();
scope.lookup(name).unwrap()
scope.lookup(name).expect(
"The symbol must be present in the symbol table, even when it is undefined in python.",
)
}
// Low level helper functions: