Fix TextIO compatibility with Python 3.6+ in LexerFile (#3067)
* Fix TextIO compatibility with Python 3.6+ in LexerFile * Sign contributors.txt
This commit is contained in:
parent
4b649103f3
commit
f7b4100fcc
|
@ -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
|
||||
|
|
|
@ -756,8 +756,11 @@ LexerFile(lexerFile, lexer, namedActions) ::= <<
|
|||
<fileHeader(lexerFile.grammarFileName, lexerFile.ANTLRVersion)>
|
||||
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>
|
||||
|
||||
|
|
Loading…
Reference in New Issue