Ticket #10047: patch.diff

File patch.diff, 1.2 KB (added by Jeff Kistler, 13 years ago)
  • django/core/files/temp.py

     
    2828            self.file = os.fdopen(fd, mode, bufsize)
    2929            self.close_called = False
    3030
     31        def __getattr__(self, name):
     32            file = self.__dict__['file']
     33            a = getattr(file, name)
     34            if type(a) != type(0):
     35                setattr(self, name, a)
     36            return a
     37
    3138        # Because close can be called during shutdown
    3239        # we need to cache os.unlink and access it
    3340        # as self.unlink only
     
    4855        def __del__(self):
    4956            self.close()
    5057
    51         def read(self, *args):          return self.file.read(*args)
    52         def seek(self, offset):         return self.file.seek(offset)
    53         def write(self, s):             return self.file.write(s)
    54         def __iter__(self):             return iter(self.file)
    55         def readlines(self, size=None): return self.file.readlines(size)
    56         def xreadlines(self):           return self.file.xreadlines()
     58        def __iter__(self):
     59            return iter(self.file)
    5760
    5861    NamedTemporaryFile = TemporaryFile
    5962else:
Back to Top