From d8758c03727ad2e48a522fba95000a7a2876ab8e Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Sat, 5 Apr 2025 11:30:15 +0200 Subject: [PATCH] Fix ForwardRef comparison in test for Python 3.14 --- mypyc/test-data/run-tuples.test | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/mypyc/test-data/run-tuples.test b/mypyc/test-data/run-tuples.test index afd3a956b871..5e19ab92b82f 100644 --- a/mypyc/test-data/run-tuples.test +++ b/mypyc/test-data/run-tuples.test @@ -127,16 +127,24 @@ class Inextensible(NamedTuple): x: int [file driver.py] -from typing import ForwardRef, Optional +import sys +from typing import Optional from native import ClassIR, FuncIR, Record +if sys.version_info >= (3, 14): + from test.support import EqualToForwardRef + type_forward_ref = EqualToForwardRef +else: + from typing import ForwardRef + type_forward_ref = ForwardRef + assert Record.__annotations__ == { 'st_mtime': float, 'st_size': int, 'is_borrowed': bool, 'hash': str, 'python_path': tuple, - 'type': ForwardRef('ClassIR'), + 'type': type_forward_ref('ClassIR'), 'method': FuncIR, 'shadow_method': type, 'classes': dict,