From 6f915ab39b5afc73ab2a4864382ece265c045d8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Germ=C3=A1n=20M=C3=A9ndez=20Bravo?= Date: Fri, 14 Aug 2020 15:32:12 -0700 Subject: [PATCH] Literal could be imported from typing_extensions too (#375) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Germán Méndez Bravo --- libcst/metadata/scope_provider.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcst/metadata/scope_provider.py b/libcst/metadata/scope_provider.py index 3eb79d359..2df820476 100644 --- a/libcst/metadata/scope_provider.py +++ b/libcst/metadata/scope_provider.py @@ -739,7 +739,7 @@ def _handle_string_annotation( def visit_Subscript(self, node: cst.Subscript) -> Optional[bool]: if any( - qn.name == "typing.Literal" + qn.name in ("typing.Literal", "typing_extensions.Literal") for qn in self.scope.get_qualified_names_for(node.value) ): node.value.visit(self)