From 0d5f32ae15d422d24281751c2abdc69e7d6140c1 Mon Sep 17 00:00:00 2001 From: Pilou Date: Thu, 6 Sep 2018 17:29:18 +0200 Subject: [PATCH] Fix Python 2 compatibility: use absolute imports (#20) Exception was: Traceback (most recent call last): File "vault/bin/vault", line 11, in sys.exit(main()) File "vault/local/lib/python2.7/site-packages/vault_cli/vault.py", line 224, in main return cli(default_map=config) File "vault/local/lib/python2.7/site-packages/click/core.py", line 722, in __call__ return self.main(*args, **kwargs) File "vault/local/lib/python2.7/site-packages/click/core.py", line 697, in main rv = self.invoke(ctx) File "vault/local/lib/python2.7/site-packages/click/core.py", line 1063, in invoke Command.invoke(self, ctx) File "vault/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke return ctx.invoke(self.callback, **ctx.params) File "vault/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke return callback(*args, **kwargs) File "vault/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func return f(get_current_context(), *args, **kwargs) File "vault/local/lib/python2.7/site-packages/vault_cli/vault.py", line 59, in cli from vault_cli import requests as backend_module File "vault/local/lib/python2.7/site-packages/vault_cli/requests.py", line 31, in class Session(requests.Session): AttributeError: 'module' object has no attribute 'Session' --- CHANGELOG.md | 4 ++++ vault_cli/requests.py | 2 ++ 2 files changed, 6 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..9f7b78b --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,4 @@ +CHANGELOG +========= + +* [BUGFIX] Fix Python 2 compatibility (#20) diff --git a/vault_cli/requests.py b/vault_cli/requests.py index a828433..33ec835 100644 --- a/vault_cli/requests.py +++ b/vault_cli/requests.py @@ -15,6 +15,8 @@ See the License for the specific language governing permissions and limitations under the License. """ +from __future__ import absolute_import + import requests import urllib3