summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/configHandler.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/idlelib/configHandler.py')
-rw-r--r--Lib/idlelib/configHandler.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/idlelib/configHandler.py b/Lib/idlelib/configHandler.py
index b5d9769..66bad74 100644
--- a/Lib/idlelib/configHandler.py
+++ b/Lib/idlelib/configHandler.py
@@ -139,7 +139,12 @@ class IdleUserConfParser(IdleConfParser):
"""
if not self.IsEmpty():
- cfgFile=open(self.file,'w')
+ fname = self.file
+ try:
+ cfgFile = open(fname, 'w')
+ except IOError:
+ fname.unlink()
+ cfgFile = open(fname, 'w')
self.write(cfgFile)
else:
self.RemoveFile()