Skip to content

Commit 9908123

Browse files
committed
Don't use fancy new Python features like 'with' - some bots don't have them
and can't bootstrap the parser.
1 parent 58fe1b1 commit 9908123

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎Parser/asdl.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,11 @@ def parse(file):
398398
scanner = ASDLScanner()
399399
parser = ASDLParser()
400400

401-
with open(file) as f:
401+
try:
402+
f = open(file)
402403
buf = f.read()
404+
finally:
405+
f.close()
403406
tokens = scanner.tokenize(buf)
404407
try:
405408
return parser.parse(tokens)

0 commit comments

Comments
 (0)