summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2013-09-06 17:38:37 -0700
committerRussell Keith-Magee <russell@keith-magee.com>2013-09-06 17:38:37 -0700
commit926bc421d9bcf04a79f0026a60d3d4b0570b7fe2 (patch)
treed66afb69a3c0a57c9fb18312577870c8a99b7feb /django
parentb7451b72edfde0c1ad3c6e33a7a170f16fc53083 (diff)
parent0756a4d664b3d243a70aa53567cec5d8d25e37f7 (diff)
Merge pull request #1566 from adamsc64/ticket_11857
Fixed #11857 -- Added missing 'closed' property on TemporaryFile class.
Diffstat (limited to 'django')
-rw-r--r--django/core/files/temp.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/django/core/files/temp.py b/django/core/files/temp.py
index b607291294..3dcda17a09 100644
--- a/django/core/files/temp.py
+++ b/django/core/files/temp.py
@@ -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()