SyntaxFix
Write A Post
Hire A Developer
Questions
You can program defensively, and do your import as:
try: from urllib.request import urlopen except ImportError: from urllib2 import urlopen
and then in the code, just use:
data = urlopen(MIRRORS).read(AMOUNT2READ)