mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-19 19:15:43 +00:00
Fix scope_for_name to catch NameError properly
This commit is contained in:
parent
fde382409c
commit
5135c696e7
2 changed files with 5 additions and 5 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue