mirror of
https://github.com/RustPython/Parser.git
synced 2025-08-02 18:03:01 +00:00
Only overwrite the locals in __build_class__ if it's a class
This commit is contained in:
parent
a29fb0de12
commit
fee1b6f2c7
2 changed files with 13 additions and 2 deletions
|
@ -387,6 +387,8 @@ impl SymbolTableBuilder {
|
|||
decorator_list,
|
||||
} => {
|
||||
self.enter_scope(name, SymbolTableType::Class, statement.location.row());
|
||||
self.register_name("__module__", SymbolUsage::Assigned)?;
|
||||
self.register_name("__qualname__", SymbolUsage::Assigned)?;
|
||||
self.scan_statements(body)?;
|
||||
self.leave_scope();
|
||||
self.scan_expressions(bases, &ExpressionContext::Load)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue