Commit d19a1151 authored by Walter Dörwald's avatar Walter Dörwald

use stat attributes instead of tuple entries

and remove the unneccessary "import stat" statement.
parent 8e7e18a9
...@@ -25,7 +25,6 @@ used to query various info about the object, if available. ...@@ -25,7 +25,6 @@ used to query various info about the object, if available.
import string import string
import socket import socket
import os import os
import stat
import time import time
import sys import sys
import types import types
...@@ -410,8 +409,8 @@ class URLopener: ...@@ -410,8 +409,8 @@ class URLopener:
host, file = splithost(url) host, file = splithost(url)
localname = url2pathname(file) localname = url2pathname(file)
stats = os.stat(localname) stats = os.stat(localname)
size = stats[stat.ST_SIZE] size = stats.st_size
modified = rfc822.formatdate(stats[stat.ST_MTIME]) modified = rfc822.formatdate(stats.st_mtime)
mtype = mimetypes.guess_type(url)[0] mtype = mimetypes.guess_type(url)[0]
headers = mimetools.Message(StringIO.StringIO( headers = mimetools.Message(StringIO.StringIO(
'Content-Type: %s\nContent-Length: %d\nLast-modified: %s\n' % 'Content-Type: %s\nContent-Length: %d\nLast-modified: %s\n' %
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment