diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-08-28 18:27:09 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-08-28 18:27:09 (GMT) |
commit | fcd2a7960c610c149eec66c16e999032457f47eb (patch) | |
tree | a25d0ee3bb1ea18a14bd0a86bad54057841f76c1 /Lib/_threading_local.py | |
parent | 06509381a88aa3abb71f70674108fdeb42238606 (diff) | |
download | cpython-fcd2a7960c610c149eec66c16e999032457f47eb.zip cpython-fcd2a7960c610c149eec66c16e999032457f47eb.tar.gz cpython-fcd2a7960c610c149eec66c16e999032457f47eb.tar.bz2 |
Merged revisions 84344 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r84344 | antoine.pitrou | 2010-08-28 20:17:03 +0200 (sam., 28 août 2010) | 4 lines
Issue #1868: Eliminate subtle timing issues in thread-local objects by
getting rid of the cached copy of thread-local attribute dictionary.
........
Diffstat (limited to 'Lib/_threading_local.py')
-rw-r--r-- | Lib/_threading_local.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/_threading_local.py b/Lib/_threading_local.py index 6e8a8d8..afdd6ea 100644 --- a/Lib/_threading_local.py +++ b/Lib/_threading_local.py @@ -194,6 +194,10 @@ class local(_localbase): lock.release() def __setattr__(self, name, value): + if name == '__dict__': + raise AttributeError( + "%r object attribute '__dict__' is read-only" + % self.__class__.__name__) lock = object.__getattribute__(self, '_local__lock') lock.acquire() try: @@ -203,6 +207,10 @@ class local(_localbase): lock.release() def __delattr__(self, name): + if name == '__dict__': + raise AttributeError( + "%r object attribute '__dict__' is read-only" + % self.__class__.__name__) lock = object.__getattribute__(self, '_local__lock') lock.acquire() try: |