Skip to content

Commit

Permalink
Return a proper traits types instead of "all strings"
Browse files Browse the repository at this point in the history
  • Loading branch information
isbm committed Nov 25, 2024
1 parent 2391afe commit e65b8c5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libsysinspect/src/pylang/pylib/pysystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ pub mod syscore {
}

#[pymethod]
fn get(&self, key: String) -> String {
fn get(&self, key: String, _vm: &VirtualMachine) -> PyObjectRef {
if self.traits.is_some() {
return dataconv::to_string(self.traits.clone().and_then(|v| v.get(&key))).unwrap_or_default();
return dataconv::to_pyobjectref(self.traits.clone().and_then(|v| v.get(&key)), _vm).unwrap();
}
"".to_string()
_vm.ctx.none()
}

#[pymethod]
fn list(&self) -> StrVec {
fn list(&self, _vm: &VirtualMachine) -> StrVec {
let mut out: StrVec = StrVec(vec![]);
if let Some(traits) = self.traits.clone() {
for item in traits.items() {
Expand Down

0 comments on commit e65b8c5

Please sign in to comment.