mirror of https://github.com/python/cpython
Fix bug if tmpcache is None
This commit is contained in:
parent
798199d8a6
commit
fa59e83813
|
@ -123,8 +123,9 @@ class URLopener:
|
||||||
headers = fp.info()
|
headers = fp.info()
|
||||||
import tempfile
|
import tempfile
|
||||||
tfn = tempfile.mktemp()
|
tfn = tempfile.mktemp()
|
||||||
|
result = tfn, headers
|
||||||
if self.tempcache is not None:
|
if self.tempcache is not None:
|
||||||
self.tempcache[url] = result = tfn, headers
|
self.tempcache[url] = result
|
||||||
tfp = open(tfn, 'w')
|
tfp = open(tfn, 'w')
|
||||||
bs = 1024*8
|
bs = 1024*8
|
||||||
block = fp.read(bs)
|
block = fp.read(bs)
|
||||||
|
|
Loading…
Reference in New Issue