diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-01-14 05:12:40 +0000 |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-01-14 05:12:40 +0000 |
commit | fb3a369e8d7ab6911dcc1874ca2f0531cdaed813 (patch) | |
tree | a68c63f5a20ca17d031cb65f26c448ac59d5bd61 /Lib/tempfile.py | |
parent | 339c2d434c5b92801451b0fcdec5b3b19bada292 (diff) | |
download | cpython-fb3a369e8d7ab6911dcc1874ca2f0531cdaed813.tar.gz |
Reverting a dumb experimental version I checked in by mistake.
Diffstat (limited to 'Lib/tempfile.py')
-rw-r--r-- | Lib/tempfile.py | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/Lib/tempfile.py b/Lib/tempfile.py index 3ad6d7c085..8ac707d7e0 100644 --- a/Lib/tempfile.py +++ b/Lib/tempfile.py @@ -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 |