diff options
Diffstat (limited to 'Lib/tempfile.py')
-rw-r--r-- | Lib/tempfile.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/tempfile.py b/Lib/tempfile.py index f4f1058..0ebf6b4 100644 --- a/Lib/tempfile.py +++ b/Lib/tempfile.py @@ -124,7 +124,7 @@ class _RandomNameSequence: def __iter__(self): return self - def next(self): + def __next__(self): m = self.mutex c = self.characters choose = self.rng.choice @@ -191,7 +191,7 @@ def _get_default_tempdir(): dir = _os.path.normcase(_os.path.abspath(dir)) # Try only a few names per directory. for seq in xrange(100): - name = namer.next() + name = next(namer) filename = _os.path.join(dir, name) try: fd = _os.open(filename, flags, 0600) @@ -230,7 +230,7 @@ def _mkstemp_inner(dir, pre, suf, flags): names = _get_candidate_names() for seq in xrange(TMP_MAX): - name = names.next() + name = next(names) file = _os.path.join(dir, pre + name + suf) try: fd = _os.open(file, flags, 0600) @@ -322,7 +322,7 @@ def mkdtemp(suffix="", prefix=template, dir=None): names = _get_candidate_names() for seq in xrange(TMP_MAX): - name = names.next() + name = next(names) file = _os.path.join(dir, prefix + name + suffix) try: _os.mkdir(file, 0700) @@ -357,7 +357,7 @@ def mktemp(suffix="", prefix=template, dir=None): names = _get_candidate_names() for seq in xrange(TMP_MAX): - name = names.next() + name = next(names) file = _os.path.join(dir, prefix + name + suffix) if not _exists(file): return file |