mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +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
|
@ -23,7 +23,7 @@ def url2pathname(url):
|
|||
comp = url.split('|')
|
||||
if len(comp) != 2 or comp[0][-1] not in string.ascii_letters:
|
||||
error = 'Bad URL: ' + url
|
||||
raise IOError(error)
|
||||
raise OSError(error)
|
||||
drive = comp[0][-1].upper()
|
||||
components = comp[1].split('/')
|
||||
path = drive + ':'
|
||||
|
@ -55,7 +55,7 @@ def pathname2url(p):
|
|||
comp = p.split(':')
|
||||
if len(comp) != 2 or len(comp[0]) > 1:
|
||||
error = 'Bad path: ' + p
|
||||
raise IOError(error)
|
||||
raise OSError(error)
|
||||
|
||||
drive = urllib.parse.quote(comp[0].upper())
|
||||
components = comp[1].split('\\')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue