mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-17 01:51:39 +09:00
Merge pull request #1834 from RustPython/coolreader18/jsontests
Add json output for CPython tests
This commit is contained in:
@@ -106,6 +106,16 @@ impl PyCodeRef {
|
||||
fn co_flags(self) -> u16 {
|
||||
self.code.flags.bits()
|
||||
}
|
||||
|
||||
#[pyproperty]
|
||||
fn co_varnames(self, vm: &VirtualMachine) -> PyObjectRef {
|
||||
let varnames = self
|
||||
.code
|
||||
.varnames()
|
||||
.map(|s| vm.new_str(s.to_owned()))
|
||||
.collect();
|
||||
vm.ctx.new_tuple(varnames)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn init(ctx: &PyContext) {
|
||||
|
||||
Reference in New Issue
Block a user