diff options
Diffstat (limited to 'Lib/cgi.py')
-rwxr-xr-x | Lib/cgi.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/cgi.py b/Lib/cgi.py index 45badf6cc6..189c6d5b4a 100755 --- a/Lib/cgi.py +++ b/Lib/cgi.py @@ -184,7 +184,7 @@ def parse(fp=None, environ=os.environ, keep_blank_values=0, strict_parsing=0): # parse query string function called from urlparse, -# this is done in order to maintain backward compatiblity. +# this is done in order to maintain backward compatibility. def parse_qs(qs, keep_blank_values=0, strict_parsing=0): """Parse a query given as a string argument.""" @@ -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)" % ( |