diff options
author | Guido van Rossum <guido@python.org> | 1999-06-01 18:55:36 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1999-06-01 18:55:36 (GMT) |
commit | 6b708d569c7e0768522e6f15e3a2ca5f5c42ab6b (patch) | |
tree | 45e2eb1e84d551c2a5687ae9c0dca3b61ec8d716 /Lib | |
parent | 74311b2c27f50157f644a01a7bee937cd5414533 (diff) | |
download | cpython-6b708d569c7e0768522e6f15e3a2ca5f5c42ab6b.zip cpython-6b708d569c7e0768522e6f15e3a2ca5f5c42ab6b.tar.gz cpython-6b708d569c7e0768522e6f15e3a2ca5f5c42ab6b.tar.bz2 |
In class TemporaryFileWrapper, don't cache attributes of tpye int --
these happen to be 'closed' and 'softspace', which may change!
Noted by Dave Ascher (with slightly different solution).
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/tempfile.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/tempfile.py b/Lib/tempfile.py index 1f30126..68cc896 100644 --- a/Lib/tempfile.py +++ b/Lib/tempfile.py @@ -120,7 +120,8 @@ class TemporaryFileWrapper: def __getattr__(self, name): file = self.__dict__['file'] a = getattr(file, name) - setattr(self, name, a) + if type(a) != type(0): + setattr(self, name, a) return a |