mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Raise statement normalization in Lib/.
This commit is contained in:
parent
8b3febef2f
commit
ce36ad8a46
80 changed files with 502 additions and 530 deletions
|
@ -204,8 +204,8 @@ def _get_default_tempdir():
|
|||
if e[0] != _errno.EEXIST:
|
||||
break # no point trying more names in this directory
|
||||
pass
|
||||
raise IOError, (_errno.ENOENT,
|
||||
("No usable temporary directory found in %s" % dirlist))
|
||||
raise IOError(_errno.ENOENT,
|
||||
"No usable temporary directory found in %s" % dirlist)
|
||||
|
||||
_name_sequence = None
|
||||
|
||||
|
@ -240,7 +240,7 @@ def _mkstemp_inner(dir, pre, suf, flags):
|
|||
continue # try again
|
||||
raise
|
||||
|
||||
raise IOError, (_errno.EEXIST, "No usable temporary file name found")
|
||||
raise IOError(_errno.EEXIST, "No usable temporary file name found")
|
||||
|
||||
|
||||
# User visible interfaces.
|
||||
|
@ -331,7 +331,7 @@ def mkdtemp(suffix="", prefix=template, dir=None):
|
|||
continue # try again
|
||||
raise
|
||||
|
||||
raise IOError, (_errno.EEXIST, "No usable temporary directory name found")
|
||||
raise IOError(_errno.EEXIST, "No usable temporary directory name found")
|
||||
|
||||
def mktemp(suffix="", prefix=template, dir=None):
|
||||
"""mktemp([suffix, [prefix, [dir]]])
|
||||
|
@ -361,7 +361,7 @@ def mktemp(suffix="", prefix=template, dir=None):
|
|||
if not _exists(file):
|
||||
return file
|
||||
|
||||
raise IOError, (_errno.EEXIST, "No usable temporary filename found")
|
||||
raise IOError(_errno.EEXIST, "No usable temporary filename found")
|
||||
|
||||
class _TemporaryFileWrapper:
|
||||
"""Temporary file wrapper
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue