]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
In class TemporaryFileWrapper, don't cache attributes of tpye int --
authorGuido van Rossum <guido@python.org>
Tue, 1 Jun 1999 18:55:36 +0000 (18:55 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 1 Jun 1999 18:55:36 +0000 (18:55 +0000)
these happen to be 'closed' and 'softspace', which may change!

Noted by Dave Ascher (with slightly different solution).

Lib/tempfile.py

index 1f301262db8390fe3900e440a5879e46db6cb50d..68cc896cb87d2d7a9914814d992add8f468aa26e 100644 (file)
@@ -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