mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Remove one use of UserDict.UserDict
This commit is contained in:
parent
b34604233a
commit
2add352c43
1 changed files with 11 additions and 2 deletions
13
Lib/cgi.py
13
Lib/cgi.py
|
@ -40,7 +40,7 @@ import os
|
||||||
import urllib
|
import urllib
|
||||||
import mimetools
|
import mimetools
|
||||||
import rfc822
|
import rfc822
|
||||||
import UserDict
|
import collections
|
||||||
from io import StringIO
|
from io import StringIO
|
||||||
|
|
||||||
__all__ = ["MiniFieldStorage", "FieldStorage", "FormContentDict",
|
__all__ = ["MiniFieldStorage", "FieldStorage", "FormContentDict",
|
||||||
|
@ -781,7 +781,7 @@ class FieldStorage:
|
||||||
# Backwards Compatibility Classes
|
# Backwards Compatibility Classes
|
||||||
# ===============================
|
# ===============================
|
||||||
|
|
||||||
class FormContentDict(UserDict.UserDict):
|
class FormContentDict(collections.Mapping):
|
||||||
"""Form content as dictionary with a list of values per field.
|
"""Form content as dictionary with a list of values per field.
|
||||||
|
|
||||||
form = FormContentDict()
|
form = FormContentDict()
|
||||||
|
@ -800,6 +800,15 @@ class FormContentDict(UserDict.UserDict):
|
||||||
strict_parsing=strict_parsing)
|
strict_parsing=strict_parsing)
|
||||||
self.query_string = environ['QUERY_STRING']
|
self.query_string = environ['QUERY_STRING']
|
||||||
|
|
||||||
|
def __len__(self):
|
||||||
|
return len(self.dict)
|
||||||
|
|
||||||
|
def __iter__(self):
|
||||||
|
return iter(self.dict)
|
||||||
|
|
||||||
|
def __getitem__(self, key):
|
||||||
|
return self.dict[key]
|
||||||
|
|
||||||
|
|
||||||
class SvFormContentDict(FormContentDict):
|
class SvFormContentDict(FormContentDict):
|
||||||
"""Form content as dictionary expecting a single value per field.
|
"""Form content as dictionary expecting a single value per field.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue