Skip to content

Commit 9c7940c

Browse files
committed
gh-148510: call builtin in property test
1 parent cc16f6f commit 9c7940c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Lib/test/test_capi/test_opt.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4900,7 +4900,7 @@ def test_load_attr_property_frame_invalidates_on_code_change(self):
49004900
class C:
49014901
@property
49024902
def val(self):
4903-
return 1
4903+
return int(1)
49044904

49054905
fget = C.val.fget
49064906

@@ -4917,6 +4917,8 @@ def testfunc(*args):
49174917
self.assertIsNotNone(ex)
49184918
uops = get_opnames(ex)
49194919
self.assertIn("_LOAD_ATTR_PROPERTY_FRAME", uops)
4920+
# Check the optimizer traced through the property call.
4921+
self.assertIn("_CALL_BUILTIN_CLASS", uops)
49204922

49214923
fget.__code__ = (lambda self: 2).__code__
49224924
_testinternalcapi.clear_executor_deletion_list()

0 commit comments

Comments
 (0)