Ticket #16946: 16946.diff
File 16946.diff, 697 bytes (added by , 13 years ago) |
---|
-
django/core/files/base.py
36 36 if not hasattr(self, '_size'): 37 37 if hasattr(self.file, 'size'): 38 38 self._size = self.file.size 39 elif os.path.exists(self.file.name):40 self._size = os.path.getsize(self. file.name)39 elif self.name and os.path.exists(self.name): 40 self._size = os.path.getsize(self.name) 41 41 else: 42 42 raise AttributeError("Unable to determine the file's size.") 43 43 return self._size