Merge pull request #2613 from ImanHosseini/patch-1

Fixed TextIO compatibility with 3.6+
This commit is contained in:
Terence Parr 2019-09-10 08:19:33 -07:00 committed by GitHub
commit cd81586d3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -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

View File

@ -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
<namedActions.header>
<parser>