diff options
Diffstat (limited to 'Lib/urllib.py')
-rw-r--r-- | Lib/urllib.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py index a1e26f0..04fd50a 100644 --- a/Lib/urllib.py +++ b/Lib/urllib.py @@ -1420,7 +1420,6 @@ def reporthook(blocknum, blocksize, totalsize): # Test program def test(args=[]): - import string if not args: args = [ '/etc/passwd', @@ -1443,9 +1442,7 @@ def test(args=[]): fp = open(fn, 'rb') data = fp.read() del fp - if '\r' in data: - table = string.maketrans("", "") - data = data.translate(table, "\r") + data = data.replace("\r", "") print(data) fn, h = None, None print('-'*40) |