aboutsummaryrefslogtreecommitdiff
path: root/Parser
diff options
context:
space:
mode:
authorEli Bendersky <eliben@gmail.com>2013-09-26 06:41:36 -0700
committerEli Bendersky <eliben@gmail.com>2013-09-26 06:41:36 -0700
commit99081238e91261c74a1534988e250235f72d8d0f (patch)
tree6d7add55f7456e0b77dd33c70e46c09a907b859c /Parser
parentNormalize whitespace (diff)
downloadcpython-99081238e91261c74a1534988e250235f72d8d0f.tar.gz
cpython-99081238e91261c74a1534988e250235f72d8d0f.tar.bz2
cpython-99081238e91261c74a1534988e250235f72d8d0f.zip
Don't use fancy new Python features like 'with' - some bots don't have them
and can't bootstrap the parser.
Diffstat (limited to 'Parser')
-rw-r--r--Parser/asdl.py5
1 files changed, 4 insertions, 1 deletions
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)