Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed Python runtime Lexer.py, Parser.py to support version >= 3.5 #2935

Merged
merged 2 commits into from
Oct 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions contributors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -266,3 +266,4 @@ YYYY/MM/DD, github id, Full name, email
2020/09/16, trenki2, Markus Trenkwalder, trenki2[at]gmx[dot]net
2020/10/08, Marti2203, Martin Mirchev, mirchevmartin2203@gmail.com
2020/10/20, adamwojs, Adam Wójs, adam[at]wojs.pl
2020/10/24, cliid, Jiwu Jang, jiwujang@naver.com
6 changes: 5 additions & 1 deletion runtime/Python3/src/antlr4/Lexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
# of speed.
#/
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
from antlr4.CommonTokenFactory import CommonTokenFactory
from antlr4.atn.LexerATNSimulator import LexerATNSimulator
from antlr4.InputStream import InputStream
Expand Down
5 changes: 4 additions & 1 deletion runtime/Python3/src/antlr4/Parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
# Use of this file is governed by the BSD 3-clause license that
# can be found in the LICENSE.txt file in the project root.
import sys
from typing.io import TextIO
if sys.version_info[1] > 5:
from typing import TextIO
else:
from typing.io import TextIO
from antlr4.BufferedTokenStream import TokenStream
from antlr4.CommonTokenFactory import TokenFactory
from antlr4.error.ErrorStrategy import DefaultErrorStrategy
Expand Down