Skip to content

Commit d86b372

Browse files
committed
Fix Python 3.8 compatibility: Use typing.Tuple instead of tuple[]
ISSUE: Python 3.8 doesn't support PEP 585 generic type hints (tuple[...], list[...], etc.) Error: TypeError: 'type' object is not subscriptable CHANGE: - Import Tuple from typing module - Change 'tuple[int, str, str]' to 'Tuple[int, str, str]' COMPATIBILITY: - Works on Python 3.8+ (typing.Tuple available since 3.5) - All 950 tests pass This fixes CI failures on Python 3.8 builds.
1 parent b2e404c commit d86b372

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/unit/test_crash_isolation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
import subprocess
1010
import sys
1111
import textwrap
12+
from typing import Tuple
1213
import pytest
1314

1415

15-
def run_in_subprocess(code: str) -> tuple[int, str, str]:
16+
def run_in_subprocess(code: str) -> Tuple[int, str, str]:
1617
"""Run code in a subprocess and return exit code, stdout, stderr.
1718
1819
Returns:

0 commit comments

Comments
 (0)