diff --git a/contributors.txt b/contributors.txt index 3dcf53d07e..12dc303e0c 100644 --- a/contributors.txt +++ b/contributors.txt @@ -285,3 +285,4 @@ YYYY/MM/DD, github id, Full name, email 2020/12/01, maxence-lefebvre, Maxence Lefebvre, maxence-lefebvre@users.noreply.github.com 2020/12/03, electrum, David Phillips, david@acz.org 2021/01/25, l215884529, Qiheng Liu, 13607681+l215884529@users.noreply.github.com +2021/02/02, tsotnikov, Taras Sotnikov, taras.sotnikov@gmail.com diff --git a/tool/resources/org/antlr/v4/tool/templates/codegen/Python3/Python3.stg b/tool/resources/org/antlr/v4/tool/templates/codegen/Python3/Python3.stg index c4c73cac92..8b445dd792 100644 --- a/tool/resources/org/antlr/v4/tool/templates/codegen/Python3/Python3.stg +++ b/tool/resources/org/antlr/v4/tool/templates/codegen/Python3/Python3.stg @@ -756,8 +756,11 @@ LexerFile(lexerFile, lexer, namedActions) ::= << from antlr4 import * from io import StringIO -from typing.io import TextIO import sys +if sys.version_info[1] > 5: + from typing import TextIO +else: + from typing.io import TextIO