diff options
author | Vincent Philippon <Vincent.Philippon@ubisoft.com> | 2020-11-23 11:49:12 -0500 |
---|---|---|
committer | Vincent Philippon <Vincent.Philippon@ubisoft.com> | 2020-11-23 11:49:12 -0500 |
commit | 1517b022e0ba8d7cdf6aeb6e3022d3e129b0c53b (patch) | |
tree | 098c0bbd72cf75af3118a0ef5589f95bbe881fdc | |
parent | e6c78b21f6eb3c4d8e48924b1984b80bf312420d (diff) | |
download | httpretty-1517b022e0ba8d7cdf6aeb6e3022d3e129b0c53b.tar.gz |
Add message with context to the raised AttributeError
-rw-r--r-- | httpretty/core.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/httpretty/core.py b/httpretty/core.py index d24c762..bd04d6e 100644 --- a/httpretty/core.py +++ b/httpretty/core.py @@ -706,7 +706,11 @@ class fakesock(object): # Special case for # `hasattr(sock, "version")` call added in urllib3>=1.26. if name == 'version': - raise AttributeError() + raise AttributeError( + "HTTPretty synthesized this error to fix urllib3 compatibility " + "(see issue https://github.com/gabrielfalcao/HTTPretty/issues/409). " + "Please open an issue if this error causes further unexpected issues." + ) raise UnmockedError() return getattr(self.truesock, name) |