Skip to content

Commit 4a579b5

Browse files
authored
Merge pull request #4553 from howjmay/co_nlocals
Add co_nlocals to code object
2 parents edf5995 + fea711c commit 4a579b5

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

vm/src/builtins/code.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,11 @@ impl PyRef<PyCode> {
230230
vm.ctx.new_tuple(cellvars)
231231
}
232232

233+
#[pygetset]
234+
fn co_nlocals(self) -> usize {
235+
self.varnames.len()
236+
}
237+
233238
#[pygetset]
234239
fn co_firstlineno(self) -> usize {
235240
self.code.first_line_number

0 commit comments

Comments
 (0)