~ubuntu-branches/ubuntu/precise/python3.2/precise-proposed

« back to all changes in this revision

Viewing changes to Lib/tempfile.py

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2012-03-09 18:40:39 UTC
  • mfrom: (30.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20120309184039-j3yk2emxr1plyo21
Tags: 3.2.3~rc1-1
* Python 3.2.3 release candidate 1.
* Update to 20120309 from the 3.2 branch.
* Fix libpython.a symlink. Closes: #660146.
* Build-depend on xauth.
* Run the gdb tests for the debug build only.

Show diffs side-by-side

added added

removed removed

Lines of Context:
112
112
 
113
113
    characters = "abcdefghijklmnopqrstuvwxyz0123456789_"
114
114
 
115
 
    def __init__(self):
116
 
        self.rng = _Random()
 
115
    @property
 
116
    def rng(self):
 
117
        cur_pid = _os.getpid()
 
118
        if cur_pid != getattr(self, '_rng_pid', None):
 
119
            self._rng = _Random()
 
120
            self._rng_pid = cur_pid
 
121
        return self._rng
117
122
 
118
123
    def __iter__(self):
119
124
        return self