Skip to content

Commit

Permalink
Fix TextIO compatibility with Python 3.6+ in LexerFile (#3067)
Browse files Browse the repository at this point in the history
* Fix TextIO compatibility with Python 3.6+ in LexerFile

* Sign contributors.txt
  • Loading branch information
tsotnikov authored Feb 3, 2021
1 parent 4b64910 commit f7b4100
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions contributors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down

0 comments on commit f7b4100

Please sign in to comment.