diff options
author | Maximilian Hils <git@maximilianhils.com> | 2019-11-12 02:59:01 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2019-11-12 04:38:13 +0100 |
commit | bdc15cbe0c0cd5175af1b58078d65d400cca71d1 (patch) | |
tree | eb65d9f2e2c7c7d934a6d7bca53a24341d0b5a43 /mitmproxy/stateobject.py | |
parent | f97996126f7a7606f8601f0318f0a70a4e818c6c (diff) | |
download | mitmproxy-bdc15cbe0c0cd5175af1b58078d65d400cca71d1.tar.gz mitmproxy-bdc15cbe0c0cd5175af1b58078d65d400cca71d1.tar.bz2 mitmproxy-bdc15cbe0c0cd5175af1b58078d65d400cca71d1.zip |
update mypy
Diffstat (limited to 'mitmproxy/stateobject.py')
-rw-r--r-- | mitmproxy/stateobject.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/mitmproxy/stateobject.py b/mitmproxy/stateobject.py index 2c16dcda..76329236 100644 --- a/mitmproxy/stateobject.py +++ b/mitmproxy/stateobject.py @@ -1,7 +1,5 @@ -import typing -from typing import Any # noqa -from typing import MutableMapping # noqa import json +import typing from mitmproxy.coretypes import serializable from mitmproxy.utils import typecheck @@ -15,7 +13,7 @@ class StateObject(serializable.Serializable): or StateObject instances themselves. """ - _stateobject_attributes: MutableMapping[str, Any] = None + _stateobject_attributes: typing.ClassVar[typing.MutableMapping[str, typing.Any]] """ An attribute-name -> class-or-type dict containing all attributes that should be serialized. If the attribute is a class, it must implement the @@ -42,7 +40,7 @@ class StateObject(serializable.Serializable): if val is None: setattr(self, attr, val) else: - curr = getattr(self, attr) + curr = getattr(self, attr, None) if hasattr(curr, "set_state"): curr.set_state(val) else: |