Skip to content

Commit ac18171

Browse files
committed
Revert changes in commit 785bd25371
The use of 'with open()' was only introduced in python v2.6. To maintain compatibility with python v2.5 the change needs to be reverted.
1 parent 7415074 commit ac18171

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

roundup/init.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,16 @@ def loadTemplateInfo(path):
138138
return None
139139

140140
# load up the template's information
141-
with open(tif) as f:
141+
try:
142+
f = open(tif)
142143
m = email.parser.Parser().parse(f, True)
143144
ti = {}
144145
ti['name'] = m['name']
145146
ti['description'] = m['description']
146147
ti['intended-for'] = m['intended-for']
147148
ti['path'] = path
149+
finally:
150+
f.close()
148151
return ti
149152

150153
def writeHeader(name, value):

0 commit comments

Comments
 (0)