1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Merge pull request #1566 from adamsc64/ticket_11857

Fixed #11857 -- Added missing 'closed' property on TemporaryFile class.
This commit is contained in:
Russell Keith-Magee
2013-09-06 17:38:37 -07:00
3 changed files with 25 additions and 0 deletions

View File

@@ -46,6 +46,15 @@ if os.name == 'nt':
except (OSError):
pass
@property
def closed(self):
"""
This attribute needs to be accessible in certain situations,
because this class is supposed to mock the API of the class
tempfile.NamedTemporaryFile in the Python standard library.
"""
return self.file.closed
def __del__(self):
self.close()