]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix bug if tmpcache is None
authorGuido van Rossum <guido@python.org>
Wed, 21 Sep 1994 11:36:19 +0000 (11:36 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 21 Sep 1994 11:36:19 +0000 (11:36 +0000)
Lib/urllib.py

index a4a891fc4d525843a76b92ae96921b1886c93b41..651e37fc18ffb18522c215f6ecd595ed0f6f4ae4 100644 (file)
@@ -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)