Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions mypyc/test-data/run-tuples.test
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,23 @@ import sys
from typing import Optional
from native import ClassIR, FuncIR, Record

HAVE_TEST = False
if sys.version_info >= (3, 14):
from test.support import EqualToForwardRef
type_forward_ref = EqualToForwardRef
else:
try:
from test.support import EqualToForwardRef
type_forward_ref = EqualToForwardRef
HAVE_TEST = True
except ImportError as e:
# catch the case of a pymanager installed Python
# without the test module. It is excluded by default
# on Windows.
msg = 'Missing "test" module.'
if sys.platform == "win32":
msg += (' Please install a version of Python with the test module'
' by running pymanager install --force PythonTest\\<version>')
raise ImportError(msg) from e

if not HAVE_TEST:
from typing import ForwardRef
type_forward_ref = ForwardRef

Expand Down
Loading