summaryrefslogtreecommitdiff
path: root/Lib/cgi.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/cgi.py')
-rwxr-xr-xLib/cgi.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/cgi.py b/Lib/cgi.py
index 4de82ea6df..b6fd407454 100755
--- a/Lib/cgi.py
+++ b/Lib/cgi.py
@@ -552,6 +552,12 @@ class FieldStorage:
else:
self.read_single()
+ def __del__(self):
+ try:
+ self.file.close()
+ except AttributeError:
+ pass
+
def __repr__(self):
"""Return a printable representation."""
return "FieldStorage(%r, %r, %r)" % (