changeset 168:09c748a71b1b

handle overlapping files
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 26 Sep 2011 16:33:02 -0700
parents 842e1fca024a
children ab2fc6222f94
files python/require.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/python/require.py	Thu Sep 08 09:39:25 2011 -0700
+++ b/python/require.py	Mon Sep 26 16:33:02 2011 -0700
@@ -10,7 +10,7 @@
     contents = urllib2.urlopen(url).read()
     filename = url.rsplit('/', 1)[-1]
     module = filename.rsplit('.', 1)[-1]
-    dest = os.path.join(tempfile.gettempdir(), filename)
+    dest = tempfile.mkstemp(suffix='.py', prefix=module)
     f = file(dest, 'w')
     f.write(contents)
     f.close()