Alexis Metaireau avatar Alexis Metaireau committed d1b93b7 Draft

Make the unpack method always return the path it unpacked to, even if it's
not the first time.

Comments (0)

Files changed (1)

distutils2/pypi/dist.py

         If the path is given in path, use this, otherwise, generates a new one
         Return the download location.
         """
-        if path is None:
-            path = tempfile.mkdtemp()
-
         # if we do not have downloaded it yet, do it.
         if self.downloaded_location is None:
+            if path is None:
+                path = tempfile.mkdtemp()
+
             url = self.url['url']
             archive_name = urlparse.urlparse(url)[2].split('/')[-1]
             filename, headers = urllib.urlretrieve(url,
             unpack_archive(filename, path)
             self._unpacked_dir = path
 
-        return path
+        return self._unpacked_dir
 
     def _check_md5(self, filename):
         """Check that the md5 checksum of the given file matches the one in
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.