From: Eli Bendersky Date: Thu, 26 Sep 2013 13:41:36 +0000 (-0700) Subject: Don't use fancy new Python features like 'with' - some bots don't have them X-Git-Tag: v3.4.0a3~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99081238e91261c74a1534988e250235f72d8d0f;p=thirdparty%2FPython%2Fcpython.git Don't use fancy new Python features like 'with' - some bots don't have them and can't bootstrap the parser. --- diff --git a/Parser/asdl.py b/Parser/asdl.py index 1651e7f61d59..be02d9c4d603 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)