summaryrefslogtreecommitdiff
path: root/Lib/cgi.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-12-31 21:59:02 +0000
committerRaymond Hettinger <python@rcn.com>2004-12-31 21:59:02 +0000
commite77be731a0c86c0ccb358c390e47fd7c9a0fbf02 (patch)
treecf8655d4246a97bf8e77910d16029ecfefd00014 /Lib/cgi.py
parent29f9f307681081e4d1eedc507157bd3bc22c709a (diff)
downloadcpython-e77be731a0c86c0ccb358c390e47fd7c9a0fbf02.tar.gz
Remove some lambdas.
Diffstat (limited to 'Lib/cgi.py')
-rwxr-xr-xLib/cgi.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/cgi.py b/Lib/cgi.py
index cf849e85ca..268aea0c4c 100755
--- a/Lib/cgi.py
+++ b/Lib/cgi.py
@@ -34,6 +34,7 @@ __version__ = "2.6"
# Imports
# =======
+from operator import attrgetter
import sys
import os
import urllib
@@ -331,7 +332,7 @@ def parse_header(line):
Return the main content-type and a dictionary of options.
"""
- plist = map(lambda x: x.strip(), line.split(';'))
+ plist = [x.strip() for x in line.split(';')]
key = plist.pop(0).lower()
pdict = {}
for p in plist:
@@ -570,7 +571,7 @@ class FieldStorage:
if key in self:
value = self[key]
if type(value) is type([]):
- return map(lambda v: v.value, value)
+ return map(attrgetter('value'), value)
else:
return value.value
else:
@@ -592,7 +593,7 @@ class FieldStorage:
if key in self:
value = self[key]
if type(value) is type([]):
- return map(lambda v: v.value, value)
+ return map(attrgetter('value'), value)
else:
return [value.value]
else: