From b9666bc90c642dd504cea7ac404c16f821f25389 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Wed, 28 Jun 2023 16:32:17 -0700 Subject: [PATCH] Fix tests on 3.7 --- mypyc/irbuild/classdef.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mypyc/irbuild/classdef.py b/mypyc/irbuild/classdef.py index 59b1c05a0ddbd..fcb2afba0939f 100644 --- a/mypyc/irbuild/classdef.py +++ b/mypyc/irbuild/classdef.py @@ -498,6 +498,9 @@ def populate_non_ext_bases(builder: IRBuilder, cdef: ClassDef) -> Value: if builder.options.capi_version < (3, 8): # TypedDict was added to typing in Python 3.8. module = "typing_extensions" + # It needs to be "_TypedDict" on typing_extensions 4.7.0+ + # and "TypedDict" otherwise. + name = "_TypedDict" else: # In Python 3.9 TypedDict is not a real type. name = "_TypedDict"