projects
/
python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
58fe1b1
)
Don't use fancy new Python features like 'with' - some bots don't have them
author
Eli Bendersky
<eliben@gmail.com>
Thu, 26 Sep 2013 13:41:36 +0000
(06:41 -0700)
committer
Eli Bendersky
<eliben@gmail.com>
Thu, 26 Sep 2013 13:41:36 +0000
(06:41 -0700)
and can't bootstrap the parser.
Parser/asdl.py
patch
|
blob
|
history
diff --git
a/Parser/asdl.py
b/Parser/asdl.py
index 1651e7f61d59c67d635f593a9b4487ba6a0ac9d9..be02d9c4d60323a55d2f9f5aa54fa82d4bf0519e 100644
(file)
--- 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)