Commit 5bfd0aec authored by Eli Bendersky's avatar Eli Bendersky

Don't use fancy new Python features like 'with' - some bots don't have them

and can't bootstrap the parser.
parent e72cfae9
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment