forked from jasder/antlr
Fixed TextIO compatibility with 3.6+
Fixing this issue: https://github.com/antlr/antlr4/issues/2611 (and probably https://github.com/antlr/antlr4/issues/2193) TextIO has moved since Python 3.6 so it should be imported considering the change for new versions.
This commit is contained in:
parent
e4737db19f
commit
d667b90bc9
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue