mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Replace IOError with OSError (#16715)
This commit is contained in:
parent
16bdd4120d
commit
f7a17b48d7
121 changed files with 381 additions and 386 deletions
|
@ -142,7 +142,7 @@ class IdleUserConfParser(IdleConfParser):
|
|||
fname = self.file
|
||||
try:
|
||||
cfgFile = open(fname, 'w')
|
||||
except IOError:
|
||||
except OSError:
|
||||
os.unlink(fname)
|
||||
cfgFile = open(fname, 'w')
|
||||
with cfgFile:
|
||||
|
@ -207,7 +207,7 @@ class IdleConf:
|
|||
userDir+',\n but the path does not exist.\n')
|
||||
try:
|
||||
sys.stderr.write(warn)
|
||||
except IOError:
|
||||
except OSError:
|
||||
pass
|
||||
userDir = '~'
|
||||
if userDir == "~": # still no path to home!
|
||||
|
@ -217,7 +217,7 @@ class IdleConf:
|
|||
if not os.path.exists(userDir):
|
||||
try:
|
||||
os.mkdir(userDir)
|
||||
except (OSError, IOError):
|
||||
except OSError:
|
||||
warn = ('\n Warning: unable to create user config directory\n'+
|
||||
userDir+'\n Check path and permissions.\n Exiting!\n\n')
|
||||
sys.stderr.write(warn)
|
||||
|
@ -251,7 +251,7 @@ class IdleConf:
|
|||
raw=raw)))
|
||||
try:
|
||||
sys.stderr.write(warning)
|
||||
except IOError:
|
||||
except OSError:
|
||||
pass
|
||||
try:
|
||||
if self.defaultCfg[configType].has_option(section,option):
|
||||
|
@ -268,7 +268,7 @@ class IdleConf:
|
|||
(option, section, default))
|
||||
try:
|
||||
sys.stderr.write(warning)
|
||||
except IOError:
|
||||
except OSError:
|
||||
pass
|
||||
return default
|
||||
|
||||
|
@ -380,7 +380,7 @@ class IdleConf:
|
|||
(element, themeName, theme[element]))
|
||||
try:
|
||||
sys.stderr.write(warning)
|
||||
except IOError:
|
||||
except OSError:
|
||||
pass
|
||||
colour=cfgParser.Get(themeName,element,default=theme[element])
|
||||
theme[element]=colour
|
||||
|
@ -637,7 +637,7 @@ class IdleConf:
|
|||
(event, keySetName, keyBindings[event]))
|
||||
try:
|
||||
sys.stderr.write(warning)
|
||||
except IOError:
|
||||
except OSError:
|
||||
pass
|
||||
return keyBindings
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue