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
8373218e
Commit
8373218e
authored
Jan 14, 2001
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reverting a dumb experimental version I checked in by mistake.
parent
2caf8df8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
9 deletions
+2
-9
Lib/tempfile.py
Lib/tempfile.py
+2
-9
No files found.
Lib/tempfile.py
View file @
8373218e
...
...
@@ -89,7 +89,6 @@ elif os.name == 'mac':
else
:
template
=
'tmp'
# XXX might choose a better one
_pidcache
=
{}
def
gettempprefix
():
"""Function to calculate a prefix of the filename to use.
...
...
@@ -97,15 +96,9 @@ def gettempprefix():
notion, so that concurrent processes don't generate the same prefix.
"""
global
template
if
template
is
None
:
p
=
os
.
getpid
()
t
=
_pidcache
.
get
(
p
,
0
)
if
t
:
return
t
if
len
(
_pidcache
)
>
100
:
# stop unbounded growth
_pidcache
.
clear
()
t
=
_pidcache
[
p
]
=
'@'
+
`p`
+
'.'
return
t
return
'@'
+
`os.getpid()`
+
'.'
else
:
return
template
...
...
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