Fix old urllib/urllib2/urlparse usage.

This commit is contained in:
Georg Brandl 2008-06-23 11:44:14 +00:00
parent 0f7ede4569
commit 029986af24
7 changed files with 42 additions and 39 deletions

View file

@ -9,7 +9,8 @@ bootstrap issues (/usr/bin/python is Python 2.3 on OSX 10.4)
Usage: see USAGE variable in the script.
"""
import platform, os, sys, getopt, textwrap, shutil, urllib2, stat, time, pwd
import platform, os, sys, getopt, textwrap, shutil, stat, time, pwd
import urllib.request
import grp
INCLUDE_TIMESTAMP = 1
@ -442,7 +443,7 @@ def downloadURL(url, fname):
if KNOWNSIZES.get(url) == size:
print("Using existing file for", url)
return
fpIn = urllib2.urlopen(url)
fpIn = urllib.request.urlopen(url)
fpOut = open(fname, 'wb')
block = fpIn.read(10240)
try: