mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-21 12:05:27 +00:00
Merge pull request #1232 from corona10/gh-1212
gh-1212: Fix scope_for_name to catch NameError properly
This commit is contained in:
commit
6128b2b46e
2 changed files with 5 additions and 5 deletions
|
@ -1912,7 +1912,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