diff options
Diffstat (limited to 'Lib/cgi.py')
-rwxr-xr-x | Lib/cgi.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/cgi.py b/Lib/cgi.py index 45badf6cc64..26d25444080 100755 --- a/Lib/cgi.py +++ b/Lib/cgi.py @@ -566,6 +566,12 @@ class FieldStorage: 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)" % ( |