Issue #20289: cgi.FieldStorage() now supports the context management protocol.
diff --git a/Lib/cgi.py b/Lib/cgi.py
index 1ef780c..a55232e 100755
--- a/Lib/cgi.py
+++ b/Lib/cgi.py
@@ -566,6 +566,12 @@
         except AttributeError:
             pass
 
+    def __enter__(self):
+        return self
+
+    def __exit__(self, *args):
+        self.file.close()
+
     def __repr__(self):
         """Return a printable representation."""
         return "FieldStorage(%r, %r, %r)" % (