From 94f872fb817b0257e914762a784e938c2afeee44 Mon Sep 17 00:00:00 2001 From: Rob Weber Date: Tue, 27 Aug 2019 15:03:43 -0500 Subject: [PATCH] use future for urllib2 --- addon.xml | 1 + default.py | 3 ++- launcher.py | 2 +- resources/lib/tinyurl.py | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/addon.xml b/addon.xml index 4aaed8e..d5e07d6 100644 --- a/addon.xml +++ b/addon.xml @@ -5,6 +5,7 @@ + diff --git a/default.py b/default.py index 9062a64..42f07ae 100644 --- a/default.py +++ b/default.py @@ -1,4 +1,5 @@ -import sys, urlparse +import sys +from future.moves.urllib.request import urlparse from kodi_six import xbmc, xbmcgui import resources.lib.utils as utils from resources.lib.backup import XbmcBackup diff --git a/launcher.py b/launcher.py index 6868fb8..5232b51 100644 --- a/launcher.py +++ b/launcher.py @@ -1,5 +1,5 @@ import sys -import urlparse +from future.moves.urllib.request import urlparse from kodi_six import xbmc, xbmcgui, xbmcvfs import resources.lib.utils as utils from resources.lib.authorizers import DropboxAuthorizer,GoogleDriveAuthorizer diff --git a/resources/lib/tinyurl.py b/resources/lib/tinyurl.py index 35e6c92..af5ca82 100644 --- a/resources/lib/tinyurl.py +++ b/resources/lib/tinyurl.py @@ -1,10 +1,10 @@ -import urllib2 +from future.moves.urllib.request import urlopen #this is duplicated in snipppets of code from all over the web, credit to no one #in particular - to all those that have gone before me! def shorten(aUrl): tinyurl = 'http://tinyurl.com/api-create.php?url=' - req = urllib2.urlopen(tinyurl + aUrl) + req = urlopen(tinyurl + aUrl) data = req.read() #should be a tiny url