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).
This commit is contained in:
Guido van Rossum 1999-06-01 18:55:36 +00:00
parent 74311b2c27
commit 6b708d569c
1 changed files with 2 additions and 1 deletions

View File

@ -120,7 +120,8 @@ class TemporaryFileWrapper:
def __getattr__(self, name): def __getattr__(self, name):
file = self.__dict__['file'] file = self.__dict__['file']
a = getattr(file, name) a = getattr(file, name)
setattr(self, name, a) if type(a) != type(0):
setattr(self, name, a)
return a return a