mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-09 22:49:57 +09:00
Merge pull request #2700 from DimitrisJim/bound_repr
Fallback to __name__ if __qualname__ isn't available.
This commit is contained in:
@@ -453,7 +453,7 @@ impl PyBoundMethod {
|
||||
if let Some(qname) = vm.get_attribute_opt(self.function.clone(), "__qualname__")? {
|
||||
Some(qname)
|
||||
} else {
|
||||
vm.get_attribute_opt(self.function.clone(), "__qualname__")?
|
||||
vm.get_attribute_opt(self.function.clone(), "__name__")?
|
||||
};
|
||||
let funcname: Option<PyStrRef> = funcname.and_then(|o| o.downcast().ok());
|
||||
Ok(format!(
|
||||
|
||||
Reference in New Issue
Block a user