fix: codegen bug in CPython 3.7~3.10

This commit is contained in:
Shunsuke Shibayama 2024-10-10 13:34:19 +09:00
parent 83c57edf0e
commit b7647c7f80
2 changed files with 5 additions and 1 deletions

View file

@ -2799,7 +2799,9 @@ impl PyCodeGenerator {
return self.emit_call_fake_method(obj, func_name, method_name, args);
}
let is_type = method_name.ref_t().is_poly_meta_type();
let kind = if self.py_version.minor >= Some(11) || method_name.vi.t.is_method() {
let kind = if self.py_version.minor >= Some(11)
|| (method_name.vi.t.is_method() && args.kw_args.is_empty())
{
BoundAttr
} else {
UnboundAttr