Skip to content

Commit

Permalink
Don't use fancy new Python features like 'with' - some bots don't hav…
Browse files Browse the repository at this point in the history
…e them

and can't bootstrap the parser.
  • Loading branch information
eliben committed Sep 26, 2013
1 parent 58fe1b1 commit 9908123
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Parser/asdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9908123

Please sign in to comment.