@@ -142,7 +142,7 @@ def Save(self):
142142 fname = self .file
143143 try :
144144 cfgFile = open (fname , 'w' )
145- except IOError :
145+ except OSError :
146146 os .unlink (fname )
147147 cfgFile = open (fname , 'w' )
148148 with cfgFile :
@@ -207,7 +207,7 @@ def GetUserCfgDir(self):
207207 userDir + ',\n but the path does not exist.\n ' )
208208 try :
209209 sys .stderr .write (warn )
210- except IOError :
210+ except OSError :
211211 pass
212212 userDir = '~'
213213 if userDir == "~" : # still no path to home!
@@ -217,7 +217,7 @@ def GetUserCfgDir(self):
217217 if not os .path .exists (userDir ):
218218 try :
219219 os .mkdir (userDir )
220- except ( OSError , IOError ) :
220+ except OSError :
221221 warn = ('\n Warning: unable to create user config directory\n ' +
222222 userDir + '\n Check path and permissions.\n Exiting!\n \n ' )
223223 sys .stderr .write (warn )
@@ -251,7 +251,7 @@ def GetOption(self, configType, section, option, default=None, type=None,
251251 raw = raw )))
252252 try :
253253 sys .stderr .write (warning )
254- except IOError :
254+ except OSError :
255255 pass
256256 try :
257257 if self .defaultCfg [configType ].has_option (section ,option ):
@@ -268,13 +268,11 @@ def GetOption(self, configType, section, option, default=None, type=None,
268268 (option , section , default ))
269269 try :
270270 sys .stderr .write (warning )
271- except IOError :
271+ except OSError :
272272 pass
273273 return default
274-
275274 def SetOption (self , configType , section , option , value ):
276275 """In user's config file, set section's option to value.
277-
278276 """
279277 self .userCfg [configType ].SetOption (section , option , value )
280278
@@ -380,7 +378,7 @@ def GetThemeDict(self,type,themeName):
380378 (element , themeName , theme [element ]))
381379 try :
382380 sys .stderr .write (warning )
383- except IOError :
381+ except OSError :
384382 pass
385383 colour = cfgParser .Get (themeName ,element ,default = theme [element ])
386384 theme [element ]= colour
@@ -637,13 +635,11 @@ def GetCoreKeys(self, keySetName=None):
637635 (event , keySetName , keyBindings [event ]))
638636 try :
639637 sys .stderr .write (warning )
640- except IOError :
638+ except OSError :
641639 pass
642640 return keyBindings
643-
644641 def GetExtraHelpSourceList (self ,configSet ):
645642 """Fetch list of extra help sources from a given configSet.
646-
647643 Valid configSets are 'user' or 'default'. Return a list of tuples of
648644 the form (menu_item , path_to_help_file , option), or return the empty
649645 list. 'option' is the sequence number of the help resource. 'option'
0 commit comments