summaryrefslogtreecommitdiffstats
path: root/Lib/urllib.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1994-09-21 11:36:19 (GMT)
committerGuido van Rossum <guido@python.org>1994-09-21 11:36:19 (GMT)
commitfa59e838132ab11e1d60fe7e05c9032378c2aa7b (patch)
treeba45a80cbb2489850191bae6374a8027affc6665 /Lib/urllib.py
parent798199d8a60528a0c565926fbf21a299fd3adbf5 (diff)
downloadcpython-fa59e838132ab11e1d60fe7e05c9032378c2aa7b.zip
cpython-fa59e838132ab11e1d60fe7e05c9032378c2aa7b.tar.gz
cpython-fa59e838132ab11e1d60fe7e05c9032378c2aa7b.tar.bz2
Fix bug if tmpcache is None
Diffstat (limited to 'Lib/urllib.py')
-rw-r--r--Lib/urllib.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py
index a4a891f..651e37f 100644
--- a/Lib/urllib.py
+++ b/Lib/urllib.py
@@ -123,8 +123,9 @@ class URLopener:
headers = fp.info()
import tempfile
tfn = tempfile.mktemp()
+ result = tfn, headers
if self.tempcache is not None:
- self.tempcache[url] = result = tfn, headers
+ self.tempcache[url] = result
tfp = open(tfn, 'w')
bs = 1024*8
block = fp.read(bs)