mirror of https://github.com/python/cpython
Don't use fancy new Python features like 'with' - some bots don't have them
and can't bootstrap the parser.
This commit is contained in:
parent
58fe1b1307
commit
99081238e9
|
@ -398,8 +398,11 @@ def parse(file):
|
|||
scanner = ASDLScanner()
|
||||
parser = ASDLParser()
|
||||
|
||||
with open(file) as f:
|
||||
try:
|
||||
f = open(file)
|
||||
buf = f.read()
|
||||
finally:
|
||||
f.close()
|
||||
tokens = scanner.tokenize(buf)
|
||||
try:
|
||||
return parser.parse(tokens)
|
||||
|
|
Loading…
Reference in New Issue