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)