diff --git a/contributors.txt b/contributors.txt index 55687a831..f385aeeef 100644 --- a/contributors.txt +++ b/contributors.txt @@ -221,4 +221,5 @@ YYYY/MM/DD, github id, Full name, email 2019/07/11, olowo726, Olof Wolgast, olof@baah.se 2019/07/16, abhijithneilabraham, Abhijith Neil Abraham, abhijithneilabrahampk@gmail.com 2019/07/26, Braavos96, Eric Hettiaratchi, erichettiaratchi@gmail.com -2019/09/03, João Henrique, johnnyonflame@hotmail.com +2019/09/10, ImanHosseini, Iman Hosseini, hosseini.iman@yahoo.com +2019/09/03, João Henrique, johnnyonflame@hotmail.com \ No newline at end of file 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 ecd6af0f5..701a09a28 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 @@ -51,8 +51,11 @@ ParserFile(file, parser, namedActions, contextSuperClass) ::= << # encoding: utf-8 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