Skip to content

Commit

Permalink
Literal could be imported from typing_extensions too (#375)
Browse files Browse the repository at this point in the history
Co-authored-by: Germán Méndez Bravo <[email protected]>
  • Loading branch information
Kronuz and Kronuz authored Aug 14, 2020
1 parent 825931a commit 6f915ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libcst/metadata/scope_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6f915ab

Please sign in to comment.