diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2016-07-13 20:05:17 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2016-07-13 20:05:17 +1200 |
commit | 077850bd107d7ffe1cf3d4a8667bb04ea47beb96 (patch) | |
tree | 59e17892e13a20c051512dfd2bd6a5af5d30ca03 | |
parent | c9a0fe6a0e6d70fa2aea1b8dc337609a9439ade1 (diff) | |
download | mitmproxy-077850bd107d7ffe1cf3d4a8667bb04ea47beb96.tar.gz mitmproxy-077850bd107d7ffe1cf3d4a8667bb04ea47beb96.tar.bz2 mitmproxy-077850bd107d7ffe1cf3d4a8667bb04ea47beb96.zip |
Raise AttributeError from Options.__getattr__
-rw-r--r-- | mitmproxy/options.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mitmproxy/options.py b/mitmproxy/options.py index 7389df1f..0cc5fee1 100644 --- a/mitmproxy/options.py +++ b/mitmproxy/options.py @@ -42,7 +42,10 @@ class Options(object): return self.__class__(**self._opts) def __getattr__(self, attr): - return self._opts[attr] + if attr in self._opts: + return self._opts[attr] + else: + raise AttributeError() def __setattr__(self, attr, value): if attr not in self._opts: |