]> granicus.if.org Git - python/commitdiff
Reverting a dumb experimental version I checked in by mistake.
authorTim Peters <tim.peters@gmail.com>
Sun, 14 Jan 2001 05:12:40 +0000 (05:12 +0000)
committerTim Peters <tim.peters@gmail.com>
Sun, 14 Jan 2001 05:12:40 +0000 (05:12 +0000)
Lib/tempfile.py

index 3ad6d7c08524b3c1264c2db9dc3aafa92dcac25e..8ac707d7e0902eaf1b60ed71d95833c2f813183f 100644 (file)
@@ -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