(original) (raw)

changeset: 85801:931d95e9067f user: Eli Bendersky eliben@gmail.com date: Thu Sep 26 06:41:36 2013 -0700 files: Parser/asdl.py description: Don't use fancy new Python features like 'with' - some bots don't have them and can't bootstrap the parser. diff -r 636615849c32 -r 931d95e9067f Parser/asdl.py --- a/Parser/asdl.py Thu Sep 26 06:32:22 2013 -0700 +++ b/Parser/asdl.py Thu Sep 26 06:41:36 2013 -0700 @@ -398,8 +398,11 @@ 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) /eliben@gmail.com