aboutsummaryrefslogtreecommitdiffstats
path: root/gsxws.py
diff options
context:
space:
mode:
Diffstat (limited to 'gsxws.py')
-rwxr-xr-xgsxws.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/gsxws.py b/gsxws.py
index 23e3022..5a0597e 100755
--- a/gsxws.py
+++ b/gsxws.py
@@ -576,11 +576,10 @@ class Part(GsxObject):
image = '%s_350_350.gif' % self.partNumber
url = 'https://km.support.apple.com.edgekey.net/kb/imageService.jsp?image=%s' % image
- tmpfile = tempfile.NamedTemporaryFile(suffix=image)
+ tmpfile = tempfile.mkstemp(suffix=image)
try:
- result = urllib.urlretrieve(url, tmpfile.name)
- return result[0]
+ return urllib.urlretrieve(url, tmpfile[1])[0]
except Exception, e:
raise GsxError('Failed to fetch part image: %s' % e)