From 3499d2f7be8fe0788e26be28686cf665c5fa9269 Mon Sep 17 00:00:00 2001 From: gardar Date: Thu, 14 Mar 2019 22:22:41 +0000 Subject: [PATCH] Fix python 2 and 3 compatibility Changes to make the code compatible with both python 2 and 3, fixes #12 --- proxmox.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proxmox.py b/proxmox.py index 08554e1..e030f11 100755 --- a/proxmox.py +++ b/proxmox.py @@ -25,7 +25,7 @@ # # { "groups": ["utility", "databases"], "a": false, "b": true } -import urllib.request, urllib.parse, urllib.error +from six.moves.urllib import request, parse, error try: import json @@ -131,7 +131,7 @@ class ProxmoxAPI(object): def auth(self): request_path = '{0}api2/json/access/ticket'.format(self.options.url) - request_params = urllib.parse.urlencode({ + request_params = parse.urlencode({ 'username': self.options.username, 'password': self.options.password, })