Fix a few ResourceWarnings in idle

This commit is contained in:
Amaury Forgeot d'Arc 2011-10-03 20:33:24 +02:00
parent c3cec7868b
commit bbe7b0ad2a
2 changed files with 6 additions and 1 deletions

View file

@ -145,7 +145,8 @@ class IdleUserConfParser(IdleConfParser):
except IOError:
os.unlink(fname)
cfgFile = open(fname, 'w')
self.write(cfgFile)
with cfgFile:
self.write(cfgFile)
else:
self.RemoveFile()