Adding changes to support urllib2 in python2 and urllib.request in python 3