From 7004be508b0e14eaa3a07994630ab0dc7fd28772 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Tue, 23 Jul 2024 09:39:16 -0400 Subject: [PATCH] use type ignore --- mypy/test/teststubgen.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/mypy/test/teststubgen.py b/mypy/test/teststubgen.py index 89cd6e2f2cb4..afc41e0f69d6 100644 --- a/mypy/test/teststubgen.py +++ b/mypy/test/teststubgen.py @@ -946,15 +946,10 @@ class TestClass: @unittest.skipIf(sys.version_info < (3, 12), "Inline Generics not supported before Python3.12") def test_generic_class(self) -> None: - if sys.version_info < ( - 3, - 12, - ): # Done to prevent mypy [syntax] error on inline Generics in older versions of python - return - exec("class Test[A]: ...") - class TestClass[A]: ... + # type: ignore used for older versions of python type checking + class TestClass[A]: ... # type: ignore[invalid-syntax] output: list[str] = [] mod = ModuleType("module", "")