mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-30 03:14:22 +00:00
multidictviews should not be serializable
This commit is contained in:
parent
de1de3f626
commit
30fd285ec7
@ -4,7 +4,7 @@ from collections.abc import MutableMapping
|
||||
from mitmproxy.types import serializable
|
||||
|
||||
|
||||
class _MultiDict(MutableMapping, serializable.Serializable, metaclass=ABCMeta):
|
||||
class _MultiDict(MutableMapping, metaclass=ABCMeta):
|
||||
def __repr__(self):
|
||||
fields = (
|
||||
repr(field)
|
||||
@ -174,18 +174,8 @@ class _MultiDict(MutableMapping, serializable.Serializable, metaclass=ABCMeta):
|
||||
coll.append([key, values])
|
||||
return coll
|
||||
|
||||
def get_state(self):
|
||||
return self.fields
|
||||
|
||||
def set_state(self, state):
|
||||
self.fields = tuple(tuple(x) for x in state)
|
||||
|
||||
@classmethod
|
||||
def from_state(cls, state):
|
||||
return cls(state)
|
||||
|
||||
|
||||
class MultiDict(_MultiDict):
|
||||
class MultiDict(_MultiDict, serializable.Serializable):
|
||||
def __init__(self, fields=()):
|
||||
super().__init__()
|
||||
self.fields = tuple(
|
||||
@ -200,6 +190,16 @@ class MultiDict(_MultiDict):
|
||||
def _kconv(key):
|
||||
return key
|
||||
|
||||
def get_state(self):
|
||||
return self.fields
|
||||
|
||||
def set_state(self, state):
|
||||
self.fields = tuple(tuple(x) for x in state)
|
||||
|
||||
@classmethod
|
||||
def from_state(cls, state):
|
||||
return cls(state)
|
||||
|
||||
|
||||
class MultiDictView(_MultiDict):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user