diff options
author | Scott Wichser <blast007@users.sourceforge.net> | 2019-01-23 22:38:51 +0000 |
---|---|---|
committer | Scott Wichser <blast007@users.sourceforge.net> | 2019-01-23 22:38:51 +0000 |
commit | d85f5f6e634b80416e0cee1c80377978c6f9f6c1 (patch) | |
tree | f19e0e6ac524f31b941c7ad30b2347cb8deba532 /local/utility.py | |
parent | b431c5476514784f97985419323cf4bec9a61500 (diff) | |
download | supybot_github-d85f5f6e634b80416e0cee1c80377978c6f9f6c1.tar.gz supybot_github-d85f5f6e634b80416e0cee1c80377978c6f9f6c1.tar.bz2 supybot_github-d85f5f6e634b80416e0cee1c80377978c6f9f6c1.zip |
Through the use of 2to3 and some manual fixes, the plugin loads successfully on Python 3.
Diffstat (limited to 'local/utility.py')
-rw-r--r-- | local/utility.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/local/utility.py b/local/utility.py index 0393ae7..ad63504 100644 --- a/local/utility.py +++ b/local/utility.py @@ -2,7 +2,7 @@ import re import math import random import string -import urllib2 +import urllib.request, urllib.error, urllib.parse from datetime import datetime, timedelta import supybot.log as log @@ -11,7 +11,7 @@ import supybot.world as world import supybot.ircutils as ircutils import supybot.registry as registry -import globals +from . import globals def registryValue(plugin, name, channel=None, value=True): @@ -138,8 +138,8 @@ def getShortURL(longurl): # Temporarily disabled url = longurl try: - req = urllib2.Request("https://git.io/", data) - response = urllib2.urlopen(req) + req = urllib.request.Request("https://git.io/", data) + response = urllib.request.urlopen(req) url = response.info().getheader('Location') except IOError as e: # Bad luck |