MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / __setattr__

Method __setattr__

mitmproxy/optmanager.py:194–202  ·  view source on GitHub ↗
(self, attr, value)

Source from the content-addressed store, hash-verified

192 raise AttributeError("No such option: %s" % attr)
193
194 def __setattr__(self, attr, value):
195 # This is slightly tricky. We allow attributes to be set on the instance
196 # until we have an _options attribute. After that, assignment is sent to
197 # the update function, and will raise an error for unknown options.
198 opts = self.__dict__.get("_options")
199 if not opts:
200 super().__setattr__(attr, value)
201 else:
202 self.update(**{attr: value})
203
204 def keys(self):
205 return set(self._options.keys())

Callers

nothing calls this directly

Calls 2

updateMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected