diff options
author | Walter Dörwald <walter@livinglogic.de> | 2002-03-22 17:30:38 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2002-03-22 17:30:38 (GMT) |
commit | 92b48b739f20003086a72edde7fc708af955c49c (patch) | |
tree | 4f323ba7635a926d3e3a00ff01d0e30ff9024f3a | |
parent | cf43004b837125cd20cb01c8153860eafe7d4c92 (diff) | |
download | cpython-92b48b739f20003086a72edde7fc708af955c49c.zip cpython-92b48b739f20003086a72edde7fc708af955c49c.tar.gz cpython-92b48b739f20003086a72edde7fc708af955c49c.tar.bz2 |
use stat attributes instead of tuple entries
and remove the unneccessary "import stat" statement.
-rw-r--r-- | Lib/urllib.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py index 0279749..6faba77 100644 --- a/Lib/urllib.py +++ b/Lib/urllib.py @@ -25,7 +25,6 @@ used to query various info about the object, if available. import string import socket import os -import stat import time import sys import types @@ -410,8 +409,8 @@ class URLopener: host, file = splithost(url) localname = url2pathname(file) stats = os.stat(localname) - size = stats[stat.ST_SIZE] - modified = rfc822.formatdate(stats[stat.ST_MTIME]) + size = stats.st_size + modified = rfc822.formatdate(stats.st_mtime) mtype = mimetypes.guess_type(url)[0] headers = mimetools.Message(StringIO.StringIO( 'Content-Type: %s\nContent-Length: %d\nLast-modified: %s\n' % |