From 99081238e91261c74a1534988e250235f72d8d0f Mon Sep 17 00:00:00 2001 From: Eli Bendersky Date: Thu, 26 Sep 2013 06:41:36 -0700 Subject: [PATCH] Don't use fancy new Python features like 'with' - some bots don't have them and can't bootstrap the parser. --- Parser/asdl.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Parser/asdl.py b/Parser/asdl.py index 1651e7f61d5..be02d9c4d60 100644 --- a/Parser/asdl.py +++ b/Parser/asdl.py @@ -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)