From eb004a5ed643fc5a2a3d64bc3c16c464e3d40124 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20=C3=96stmar?= Date: Thu, 23 Nov 2017 16:33:58 +0100 Subject: [PATCH] Fix urllib import error in Py 3.5.2 Error in Python 3.5.2: AttributeError: module 'urllib' has no attribute 'build_opener' This goes for the whole lines replaced. --- got3/manager/TweetManager.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/got3/manager/TweetManager.py b/got3/manager/TweetManager.py index 5c627749..c2d7207e 100644 --- a/got3/manager/TweetManager.py +++ b/got3/manager/TweetManager.py @@ -118,9 +118,9 @@ def getJsonReponse(tweetCriteria, refreshCursor, cookieJar, proxy): ] if proxy: - opener = urllib2.build_opener(urllib2.ProxyHandler({'http': proxy, 'https': proxy}), urllib2.HTTPCookieProcessor(cookieJar)) + opener = urllib.request.build_opener(urllib.ProxyHandler({'http': proxy, 'https': proxy}), urllib.request.HTTPCookieProcessor(cookieJar)) else: - opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookieJar)) + opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cookieJar)) opener.addheaders = headers try: @@ -135,4 +135,4 @@ def getJsonReponse(tweetCriteria, refreshCursor, cookieJar, proxy): dataJson = json.loads(jsonResponse.decode()) - return dataJson \ No newline at end of file + return dataJson