Fix test_typing.test_unpack_wrong_type (#6009)

This commit is contained in:
Jeong, YunWon authored and GitHub committed 2025-07-21 00:54:14 +09:00
1 parent 99c1afe0be
commit 3bce41baab
3 files changed
+4 -5

No files matched your search

-2
View File
@@ -5074,8 +5074,6 @@ order (MRO) for bases """
gc.collect()
self.assertEqual(Parent.__subclasses__(), [])
# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_attr_raise_through_property(self):
# test case for gh-103272
class A:
-2
View File
@@ -1228,8 +1228,6 @@ class UnpackTests(BaseTestCase):
self.assertEqual(PartNew[Unpack[tuple[str]]].__args__, (int, str))
self.assertEqual(PartNew[Unpack[Tuple[str]]].__args__, (int, str))
# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_unpack_wrong_type(self):
Ts = TypeVarTuple("Ts")
class Gen[*Ts]: ...
+4 -1
View File
@@ -286,7 +286,10 @@ fn getattro_wrapper(zelf: &PyObject, name: &Py<PyStr>, vm: &VirtualMachine) -> P
let __getattr__ = identifier!(vm, __getattr__);
match vm.call_special_method(zelf, __getattribute__, (name.to_owned(),)) {
Ok(r) => Ok(r),
Err(_) if zelf.class().has_attr(__getattr__) => {
Err(e)
if e.fast_isinstance(vm.ctx.exceptions.attribute_error)
&& zelf.class().has_attr(__getattr__) =>
{
vm.call_special_method(zelf, __getattr__, (name.to_owned(),))
}
Err(e) => Err(e),