Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
6672fb8b
Commit
6672fb8b
authored
Nov 09, 2010
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify code
parent
8bcf294e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
14 deletions
+3
-14
Lib/tempfile.py
Lib/tempfile.py
+3
-14
No files found.
Lib/tempfile.py
View file @
6672fb8b
...
@@ -108,30 +108,19 @@ class _RandomNameSequence:
...
@@ -108,30 +108,19 @@ class _RandomNameSequence:
_RandomNameSequence is an iterator."""
_RandomNameSequence is an iterator."""
characters
=
(
"abcdefghijklmnopqrstuvwxyz"
+
characters
=
"abcdefghijklmnopqrstuvwxyz0123456789_"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+
"0123456789_"
)
def
__init__
(
self
):
def
__init__
(
self
):
self
.
mutex
=
_allocate_lock
()
self
.
rng
=
_Random
()
self
.
rng
=
_Random
()
self
.
normcase
=
_os
.
path
.
normcase
def
__iter__
(
self
):
def
__iter__
(
self
):
return
self
return
self
def
__next__
(
self
):
def
__next__
(
self
):
m
=
self
.
mutex
c
=
self
.
characters
c
=
self
.
characters
choose
=
self
.
rng
.
choice
choose
=
self
.
rng
.
choice
letters
=
[
choose
(
c
)
for
dummy
in
"123456"
]
m
.
acquire
()
return
''
.
join
(
letters
)
try
:
letters
=
[
choose
(
c
)
for
dummy
in
"123456"
]
finally
:
m
.
release
()
return
self
.
normcase
(
''
.
join
(
letters
))
def
_candidate_tempdir_list
():
def
_candidate_tempdir_list
():
"""Generate a list of candidate temporary directories which
"""Generate a list of candidate temporary directories which
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment